Next: Conditional Statements, Previous: Label Commands [Contents][Index]
read sOpens the file whose name is string s for reading.
closeCloses the previously opened data file.
Standard input is used unless a data file is specified at command line invocation or open for reading.
number(s)Reads a number from current input.
string(s)Reads a string from current input.
String s is used as a prompt.
Example:
l = number("Length? ")
w = number("Width? ")
draw rectangle(l, w)
When running in batch mode with no defined data file, the number
function returns 0 and the string function returns the empty string.
Output commands take a comma separated list of printable objects as arguments. Printable objects are strings, numbers, points and sets. They are formatted the same way as for conversion to string.
write sOpens the file whose name is string s for writing. If the file exists, its content will be overwritten. Otherwise, it is created.
append sOpens the file whose name is string s for appending. The file is created if it does not exist. Writing starts at the end of the file.
releaseCloses previously opened result file.
print listWrites list to current result file, or to standard output if none is open.
error listWrites list to standard error stream.
output listWrites list to output file. This may be useful to include low level PostScript or PSTricks command invocations.
Next: Conditional Statements, Previous: Label Commands [Contents][Index]