- Direct Known Subclasses:
RTS_CLASS
,RTS_PROCEDURE
The standard I/O facilities are contained by the class "BASICIO". They are available to the program through block prefixing as described below.
Note: The use of upper case letters indicates that this identifier is inaccessible to the user program (cf 1.10).
The user's main program acts as if it were embedded as follows:
BASICIO (inlength, outlength) begin ! prefixed block; inspect SYSIN do inspect SYSOUT do begin <external-head> <program> end end prefixed blockIn any program execution the unique instance of this prefixed block constitutes the system head of the outermost quasi-parallel system (see 7.2).
The values of inlength and outlength are implementation-defined; they normally depend upon the actual device(s) associated with SYSIN and SYSOUT (the standard input and output files).
SYSIN and SYSOUT may represent the input and output features of an interactive terminal, in which case inlength and outlength are probably equal. In other cases, for example batch runs, SYSIN may represent record-oriented input and SYSOUT may represent line printer oriented output. Typical values of inlength and outlength would then be 80 and 132, resp.
A program may refer to the corresponding file objects through sysin and sysout respectively. Most attributes of these file objects are directly available as the result of the connection blocks enclosing the program.
Note: Within this chapter the term "file object" refers to an instance of one of the classes "in(byte)file", "out(byte)file" and "direct(byte)file" or of a subclass of one of these.
The overall organization of "BASICIO" is as follows:
ENVIRONMENT class BASICIO (INPUT_LINELENGTH, OUTPUT_LINELENGTH); integer INPUT_LINELENGTH, OUTPUT_LINELENGTH; begin ref (infile) SYSIN; ref (printfile) SYSOUT; ref (infile) procedure sysin; sysin :- SYSIN; ref (printfile) procedure sysout; sysout :- SYSOUT; procedure terminate_program; begin ... ; goto STOP end terminate_program; class file ............................ 10.1 ; file class imagefile ....................... 10.3 ; file class bytefile ........................ 10.8 ; imagefile class infile .......................... 10.4 ; imagefile class outfile ......................... 10.5 ; imagefile class directfile ...................... 10.6 ; outfile class printfile ....................... 10.7 ; bytefile class inbytefile ...................... 10.9 ; bytefile class outbytefile ..................... 10.10 ; bytefile class directbytefile .................. 10.11 ; SYSIN :- new infile("..."); ! Implementation-defined SYSOUT :- new printfile("..."); ! files names; SYSIN.open(blanks(INPUT_LINELENGTH)); SYSOUT.open(blanks(OUTPUT_LINELENGTH)); inner; STOP: SYSIN.close; SYSOUT.close end BASICIO;
Note: The files SYSIN and SYSOUT are opened and (if not done explicitly prior to program termination) closed within "BASICIO", i.e. outside the program itself.
The class file and its predefined subclasses are available at any block level of a program (but see (2) of 5.5.1). An implementation may restrict, in any way, the use of these classes for class or block prefixing. An implementation may provide additional subclasses of class file.
Within a program, an object of a subclass of file may represent an external file. The effect of several such file objects representing the same external file is implementation-defined.
The procedure "terminate_program" terminates program execution. It closes SYSIN and SYSOUT. It is implementation-dependent with respect to whether or not other open files are also closed.
Link to GitHub: Source File.
- Author:
- SIMULA Standards Group, Øystein Myhre Andersen
-
Nested Class Summary
Nested classes/interfaces inherited from class simula.runtime.RTS_RTObject
RTS_RTObject.ForElt, RTS_RTObject.ForList, RTS_RTObject.ForListIterator, RTS_RTObject.OperationalState, RTS_RTObject.RTS_BOOLEAN_ARRAY, RTS_RTObject.RTS_BOUNDS, RTS_RTObject.RTS_CHARACTER_ARRAY, RTS_RTObject.RTS_INTEGER_ARRAY, RTS_RTObject.RTS_LABEL, RTS_RTObject.RTS_LONG_REAL_ARRAY, RTS_RTObject.RTS_NAME<T>, RTS_RTObject.RTS_REAL_ARRAY, RTS_RTObject.RTS_REALTYPE_ARRAY, RTS_RTObject.RTS_REF_ARRAY<T>, RTS_RTObject.RTS_TEXT_ARRAY, RTS_RTObject.SingleElt<T>, RTS_RTObject.SingleTValElt, RTS_RTObject.StepUntil, RTS_RTObject.UncaughtExceptionHandler, RTS_RTObject.WhileElt<T>, RTS_RTObject.WhileTValElt
-
Field Summary
Fields inherited from class simula.runtime.RTS_ENVIRONMENT
_STARTTIME, CURRENTDECIMALMARK, CURRENTLOWTEN, EXCEPTION_HANDLER, maxint, maxlongreal, maxreal, minint, minlongreal, minreal, simulaReleaseID
Fields inherited from class simula.runtime.RTS_RTObject
_CORUT, _CTX, _CUR, _DL, _INPUT_LINELENGTH, _JTX, _OUTPUT_LINELENGTH, _SL, _STATE, _SYSIN, _SYSOUT, NOTEXT
-
Constructor Summary
-
Method Summary
Methods inherited from class simula.runtime.RTS_ENVIRONMENT
_char, _IPOW, _IS, abs, abs, abs, addepsilon, addepsilon, arccos, arcsin, arctan, arctan2, Char, clocktime, cos, cosh, cotan, cputime, datetime, decimalmark, DEFEXCEPTION, digit, discrete, draw, edfix, edit, edit, edit, edit, edit, edtime, entier, Erlang, error, exp, getIntInfo, getTextInfo, giveIntInfo, giveTextInfo, hash, histd, histo, isochar, isorank, letter, linear, ln, loadChar, log10, lowcase, lowerbound, lowten, max, max, max, max, max, min, min, min, min, min, mod, negexp, normal, Poisson, printStaticChain, printThreadList, randint, rank, rem, rts_utility, sign, simulaid, sin, sinh, sqrt, storeChar, subepsilon, subepsilon, tan, tanh, uniform, upcase, upperbound, waitSomeTime
Methods inherited from class simula.runtime.RTS_RTObject
_ASGSTR, _ASGTXT, _GOTO, _JUMPTABLE, _JUMPTABLE, _LABEL, _PRE_LABEL, _PRE_TABLE, _SIM_LABEL, _STM, _TXTREL_EQ, _TXTREL_GE, _TXTREL_GT, _TXTREL_LE, _TXTREL_LT, _TXTREL_NE, _VALUE, arrayValue, BBLK, blanks, BPRG, call, call, CONC, copy, detach, detach, detach, doubleValue, EBLK, edObjectAttributes, edObjectIdent, floatValue, getErrorMessage, intValue, isDetachUsed, isQPSystemBlock, objectTraceIdentifier, objectTraceIdentifier, objectValue, procValue, resume, resume, resume, swapCoroutines, sysin, sysout, terminate_program, TRACE_GOTO, TRF_EQ, TRF_NE
-
Constructor Details
-
RTS_BASICIO
Constructor- Parameters:
staticLink
- pointer to enclosing block
-
-
Method Details
-
toString
Description copied from class:RTS_RTObject
Returns a string representation of the object.- Overrides:
toString
in classRTS_RTObject
-