System Template
write()
Write a string to the debug buffer.
Syntax
void = rb.debug.write(output, ...)
Parameters
The 'write' method takes 2 parameters:
Name | Type/Value | Range/Length | Description | output | string | | Required. The first string to be written to the debug buffer. | ... | string | | Optional. additional strings to be written. |
Results
The 'write' method returns no useful information.
Remarks The presentation engine maintains a 'debug' text buffer. This is empty at the
beginning of each page generation. This method appends one or more strings into this buffer.
By default - if the page executes successfully then the contents of this buffer
are discarded. However, in the test instance, if the page generation process generated
errors then the page the contents of the debug buffer are output as part of
the standard error page. So the default behaviour of this method is: Test Instance | The string parameter is writted to the debug buffer. The contents of the
debug buffer are written to the error page if an error occurs during page
generation - otherwise the output is discarded. | Live Instance | On a live site, by default, all calls to this method are ignored (the string
parameter is discarded and the debug buffer remains empty). |
This behaviour can be modified as follows: The rb.debug.mode() allows the
debug buffer to be enabled on the live site. This can be useful if there is
a problem that only occurs on the live site and cannot be reproduced on the
test site. The <rb:insertdebug/>
tag allows the Pattern Page to insert the contents of the debug buffer into the client page.
This is very useful in those situations where a page does not generate any errors, but
does not either generate the correct output. In these cases the error page will not be
displayed. You can use this method to write intermediate values to the debug buffer to be
displayed. This allows you to inspect the values of JavaScript expressions as a page
is executed and to understand why unexpected results occur. |