Whitebeam Template Reference Documentation

Site Map
 
Home
 
Application Guide
Reference
  Installation
  Configuration
  XML Markup
  JavaScript Classes
  ROM
  Templates
  Environment
  Dev Process
  Tools
  External Links
  Example libraries
Community
Contact Whitebeam
To-Do
Download
Credits
Licence
Whitebeam Users
 
 
 

Whitebeam Template Reference Documentation

System Template

fwrite()

Format output to the debug buffer.

Syntax

void = rb.debug.fwrite(format_str, ...)

Parameters

The 'fwrite' method takes 2 parameters:

Name Type/Value Range/Length Description
format_strstring  Required. Format specifier string.
...string  Required. Parameters to be formatted by the method.

Results

The 'fwrite' method returns no useful information.

Remarks

This method is similar to rb.debug.write except that it produces formatted output to the debug buffer in much the same was that rb.page.fwrite generates output to the client. 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>

Whitebeam release 1.3.36
(loadtime : 58ms)