My own house on the high ground...
Is the only place I want to be.
- Carole King
aztec.io.StdIO
public class final StdIO from<Base>
Base
StdIO
The StdIO class is a special IO class which handles Standard Input and Output for the Aztec system. By default, it writes a string to the Aztec StdIO Console and reads a string from the Aztec StdIO Console. If the command line "-stdio" option is used, the Aztec system assumes OS level standard IO redirection is being used on the command line, so a write operation will send the string to the OS standard ouput stream and a read operation will attempt to read a string from the OS standard input stream. The Aztec system has no reliable way of detecting the OS redirection across operating systems, so the user needs to tell Aztec to use the OS level standard input and output.
The StdIO class only contains two methods, Read() and Write(), and they are both shared methods, so the StdIO class does not need to be instantiated in order to use them. They provide a simple mechanism for the user to show output to the user and also to read data in from the user. The system is smart enough to place the cursor for the read operation directly after the last write operation, so it can be used like a standard console normally provided by an operating system command window.
The Aztec StdIO Console will be automatically displayed when the first string is written to standard output (without IO redirection), and the Console can always be shown or hidden using the option on the Aztec UI menu, which is available using the "-menu" command line option.
Due to the special way that Standard IO is used with this class, and because it only supports text input and output, it is purposefully not part of the StreamIO class hierarchy.
StreamIO Methods
| Read() |
Reads a string from the standard input mechanism (Aztec StdIO Console or OS redirected input stream) |
| Write() |
Writes a string to the standard output mechanicsm (Aztec StdIO Console or OS redirected output stream) |
Derived Classes
None
See Also
Class Hierarchy
Read()
public shared method<string> Read()
Parameters
None
Return Value
String which was read from Standard Input (empty if error occurs)
Description
This shared method performs a read operation for a string from standard input. If the Aztec "-stdio" command line option is used, then the method will attempt to perform a read operation from the OS standard input stream. If the "-stdio" command line option is not used, then the read operation is performed from the Aztec StdIO Console. A UI edit control is dynamically placed in the Aztec StdIO Console window at the location immediately after the last StdIO write operation. The read operation will finish when the user presses the Enter key.
StdIO Class
Write()
public shared method<string> Write(string OutputString, bool WriteCRLF = true)
Parameters
OutputString
String to be written to Standard Output
WriteCRLF
If true (default), appends the string with a Carriage Return character (ASC 13) and a Line Feed character (ASC 10)
Return Value
String which was written to Standard Input (empty if error occurs)
Description
This shared method performs a write operation with a string to standard output, optionally appending a CR/LF combination. If the Aztec "-stdio" command line option is used, then the method will attempt to write the string to the OS standard output stream. If the "-stdio" command line option is not used, then the string is written to the Aztec StdIO Console. If the CR/LF characters are appended (which is the default), the next read or write operation will occur at the start of the next line. If the CR/LF characters are not appended, the next read or write operation will occur on the same line immediately after the end of this string.
StdIO Class