Riverwatcher Active Content Environment

RACE Documentation:


OUTPUT - Outputting text to files or the browser



  • FILE - Filename to write to.
  • APPEND - If specified, RACE will append data to the file, rather than overwrite it.
Example - Saving text to a file
Source:

<define var="$count">1</define>
<output file="numbers.txt"><while test="<$count> < 30"><$count.add(display)>
</while></output>

Output:
numbers.txt


Example - Appending to a file
Source:

<if test="<$error> != ''">
<output append file="errorlog">
<$error></output>

Output:
This code checks if the variable <$error> is empty or not. If it is not empty, the contents are appended to a file called errorlog.


Example - Outputting text to the browser
Source:

<system output="off">
This text will not be displayed because system output is set to off. However, text within an output tag will be displayed.
<define var="$count">0</define>
<while test="<$count> <= 10">
  <$count.add()>
  <if test="<$count.isinteger(even)> > 0">
    <output><$count> is an even number<br></output>
  </if>
</while>

Output:
2 is an even number
4 is an even number
6 is an even number
8 is an even number
10 is an even number


note: See the documentation for the SYSTEM tag for further examples.




RACE Documentation



 
Copyright 2009 Riverwatcher, Inc. Hosting by Riverwatcher Studios