|
Whitebeam Template Reference Documentation
|
System Template
fwrite()
Format output to browser.
Syntax
void = rb.page.fwrite(format_str, ...)
Parameters
The 'fwrite' method takes 2 parameters:
Name | Type/Value | Range/Length | Description | format_str | string | | Required. Format specifier string. | ... | string | | Optional. Parameters to be formatted by the method. |
Results
The 'fwrite' method returns no useful information.
Remarks This is a formatted output method. For anyone familiar with 'C' or 'C++' - it
is very similar to the 'printf' family of functions. The first paramter is a format string,
the subsequent parameters are values to be substituted into the string. The format string itself is s subset of the 'C' definition with additions to support
automatic repitition of formats on array elements. Parameter substitution
is identified by a '%' character within the format string. This specified is followed by
the format to be used for the paramters. For details of how to use the format specifiers - reference the
rb.page.format method.
Example
<rb:script>
var text = "Hello World";
rb.debug.fwrite("<h1>%s</h1>\n",text);
</rb:script>
This will replace the <rb:script> tag with the text
<h1>Hello World </h1>
|
|
(loadtime : 392ms) |