Index | | | Related pages | | | Classes | | | Functions | | | Entities | | | Function Sets | | | Groups |
Functions providing basic interface. more...
input | Get some text from the user (standard input stream). |
inspect | Displays the deep contents of an item. |
inspectShort | Displays the deep contents of an item (short version). |
Prints the contents of various items to the standard output stream. | |
printl | Prints the contents of various items to the VM standard output stream, and adds a newline. |
RTL Basic I/O functions are mainly meant to provide scripts with a very basic interface to interact with the outside world.
Get some text from the user (standard input stream).
input( ) |
Reads a line from the standard input stream and returns a string containing the read data. This is mainly meant as a test/debugging function to provide the scripts with minimal console based user input support. When in need of reading lines from the standard input, prefer the readLine() method of the input stream object.
This function may also be overloaded by embedders to provide the scripts with a common general purpose input function, that returns a string that the user is queried for.
Displays the deep contents of an item.
inspect( ... ) | |
... | An arbitrary list of items. |
This is mainly a debugging function that prints all the available informations on the item on the standard output stream. This function should not be used except for testing scripts and checking what they put in arrays, dictionaries, objects, classes or simple items.
Output is sent to the VM auxiliary stream; for stand-alone scripts, this translates into the "standard error stream". Embedders may provide simple debugging facilities by overloading and interceptiong the VM auxiliary stream and provide separate output for that.
This function traverse arrays and items deeply; there isn't any protection against circular references, which may cause endless loop. If the inspected items can be subject to circular references, use the inspectShort function instead.
Displays the deep contents of an item (short version).
inspectShort( ... ) | |
... | An arbitrary list of items. |
This function works as inspect, but it provides a shorter output and scans items only three level deep. This is generally enough to know exactly the nature of items and of their immediate contents, and prevents endless loops when the items have circular relations.
Prints the contents of various items to the standard output stream.
print( ... ) | |
... | An arbitrary list of parameters. |
This function is the default way for a script to say something to the outer world. Scripts can expect print to do a consistent thing with respect to the environment they work in; stand alone scripts will have the printed data to be represented on the VM output stream. The stream can be overloaded to provide application supported output; by default it just passes any write to the process output stream.
The items passed to print are just printed one after another, with no separation. After print return, the standard output stream is flushed and the cursor (if present) is moved past the last character printed. The function printl must be used, or a newline character must be explicitly placed among the output items.
The print function has no support for pretty print (i.e. numeric formatting, space padding and so on). Also, it does NOT automatically call the toString() method of objects.
See also printl.
Prints the contents of various items to the VM standard output stream, and adds a newline.
printl( ... ) | |
... | An arbitrary list of parameters. |
This functions works exactly as print, but it adds a textual "new line" after all the items are printed. The actual character sequence may vary depending on the underlying system.
See also print.
Index | | | Related pages | | | Classes | | | Functions | | | Entities | | | Function Sets | | | Groups |