[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

2.3.1.2 Output (#S)

The Output command simply writes its argument to the outfile, followed by a carriage return. It is the primary means by which the user annotates a response (adds codes to a test item). Cogsys variables will be substituted with their values if the `^' operator is used before the variable name.

Name:
Output
Class:
Control
Code:
#S
Syntax:
#S/text/ - or - #S[text]
#S/text ... ^Vx ... /
text is a string
Vx is a variable reference to variable number x
Output:
The contents of text are written, substituting values of myvar if present.
History:
In Cogsys 3.0, all commands were changed to use the standard square brackets for parameters. However, because #S is such a widely used command, it still supports the older `/ ... /' delimiters, as well.

Test Files:
OUTP_T01.IN: Tests basic operation

 
@CPress any key to write the string "Hello world" to the
output file (\#S/Hello world/)#R
#S/Hello world/
Done.  Press any key to exit.#R

OUTP_B01.IN: Measures overhead to write 1000 characters to output file

 
@CTiming overhead for 20 50-character write to output buffer.
Press any key to start.#R
#Y[2,0]
#S/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/
#S/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/
#S/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/
#S/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/
#S/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/
#S/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/
#S/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/
#S/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/
#S/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/
#S/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/
#S/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/
#S/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/
#S/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/
#S/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/
#S/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/
#S/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/
#S/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/
#S/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/
#S/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/
#S/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/
#Y[2,1]
@1010 1000-character write took $SV5 milliseconds
@1210 Hit any key to exit#R

Examples:
input
#S[This goes to output]
output
`This goes to output'

input
$AV20=45#S[Value of V20: ^V20]
output
`Value of V20: 45'

input
#S/0234/
output
`0234'



This document was generated on November, 24 2008 using texi2html