@Section(SOFTWARE TOOLS)@Label(Lib) The function of libraries is to make available to programmers useful sets of related definitions and Procedures for use in the construction of programs. In general, it is sensible to use a supported library where one is available rather than writing ad hoc routines. The main libraries are callable from both IMP and Pascal, with different include files for the two languages available in the directory INC. The IMP versions have file-name extension .IMP and the Pascal versions have the extension .PAS. The relevant include file should be consulted for details of the parameter types in language-specific terms. The main libraries are @Begin(Enumerate) @b[INC:UTIL] General utility procedures. @b[INC:PAM] PAM is a set of procedures which may be called by programs to set up file-names and option values. First, the appropriate DEFINE ... PARAM procedure is called for each individual file-name or option, and then the main procedure PROCESS PARAMETERS is called to do the assignment of values. Usually the string provided to PROCESS PARAMETERS will be the one typed by the user in the command calling the program, available via the string function CLIPARAM. The first argument to the DEFINE procedures is a text string which is used as a prompt if the associated program parameter is being acquired interactively. @b[INC:MATHS] Mathematical procedures and constants. @b[INC:VTLIB] This package provides support for conventional visual display units in terms of a limited number of screen operations together with ordinary character input/output (READ, WRITE, etc). (Floating-point I/O is not included at present). Programs including INC:VTLIB must also include INC:UTIL. Before calling any of the other procs, SET VIDEO MODE should be called to establish the required mode of operation. SET VIDEO MODE is an extension of SET TERMINAL MODE. For more information on VTLIB see section @REF(VTLI). @b[INC:DICT] System Symbol Dictionary. For more information on DICT see section @Ref(DICT) @b[INC:ECCE] Editor. @b[INC:FS] Ethernet and Filestore communication. For more information see section @Label(FsInc). @End(Enumerate) All the procedures (Proc), functions (Func), integer constants (Inte), real constants (Real), byte constants (Byte), record types (Reco) of these libraries are listed below, in alphabetical order. @Begin(FileExample, LeftMargin +0) @b[Name Lib Type What it does] ACK FS Inte Constant. ANYSCROLL VTLI Inte Constant. (=128) ARC COS MATH Func ARC SIN MATH Func ARC TAN MATH Func BLINK VTLI Inte Constant. BS VTLI Inte Constant. CLEAR FRAME VTLI Proc Clear all of current frame. CLEAR LINE VTLI Proc Clear rest of current line. CLOSEAPPEND PAM Proc CONNECT EDFILE ECCE Proc Connect a file to be edited. CONNECT FILE PAM Proc Connect (read in) the file denoted by FNAME to an area of store allocated from the heap. COPY PAM Proc COS MATH Func COS H MATH Func CYLOCK FS Byte DATE UTIL Func Current date in form DD/MM/YY. DEFINE BOOLEAN PARAMS PAM Proc Define a group of Boolean parameters as a set. DEFINE ENUM PARAM PAM Proc Define an enumeration (Text should start with a sequence of comma -separated keywords). DEFINE INT PARAM PAM Proc Define an integer parameter. DEFINE PARAM PAM Proc Define a string parameter (including an input or output filename). DEFNAME DICT Func Allocate and return address of cell for name S in dictionary D. DEL VTLI Inte Constant. DELETE PAM Proc DICTF DICT reco Beg, Pos, Lim, Alt: Integer. DISABLE BROADCASTS FS Proc DISCONNECT EDFILE ECCE Proc Close off an edited file. DtoR MATH Real Constant. Degrees to Radians. DTX FS Inte Constant. E MATH Real Constant. EDFILE ECCE Reco START1,LIM1, (part 1) START2,LIM2, (part 2) LIM, (VMLIM) LBEG,FP,CHANGE,FLAG, LINE (line number of current pos), DIFF (diff between LINE and ROW), TOP (top row of sub_window), WIN (floating top), BOT (bottom row of sub_window), MIN (minimum window size), ROW (last row position), COL (last col position):Byte; NAME:String[127] EDI ECCE Proc Call the editor. ENABLE BROADCASTS FS Proc ERR FS Inte Constant. ESC VTLI Inte Constant. ETHC FS Byte Constant. ETHD FS Byte Constant. ETHERCLOSE FS Proc Close previously opened port . ETHERDTX FS Proc ETHEROPEN FS Proc Open port to . Port should be a previously unopened port. ETHERREAD FS Func Suspend program until a block appears on port . Place it in a buffer of length starting at and return the actual number of bytes read. ETHERSTATION FS Func Returns the station number of the APM calling it. ETHERWRITE FS Proc Transmit a block of data of length starting ad address on port . ETHS FS Byte Constant. EXISTS PAM Func EXP MATH Func FCOMM FS Func Filestore communication. FCOMMR FS Func Filestore communication. FCOMMW FS Proc Filestore communication. FF VTLI Inte Constant. FILESIZE PAM Func FREESTORE UTIL Func Amount of stack space currently free (in bytes). FREEZE VTLI Inte Constant. FSPORT FS Byte FULLSCROLL VTLI Inte Constant. (=64) GOTOXY VTLI Proc Cursor addressing, COL first. GRAPHICAL VTLI Inte Constant. HEAPGET UTIL Func Returns address of allocated space of SIZE bytes. HEAPPUT UTIL Proc Dispose of heap storage at the given address. INFILENAME PAM Func INTENSE VTLI Inte Constant. ITOS UTIL Func Integer to string. LDTE FS byte Constant. LF VTLI Inte Constant. LOG MATH Func LOG TEN MATH Func LSAP FS Byte Constant. MARK UTIL Proc MULDIV UTIL Func Result is A * B Div C without overflow hazard computing A * B. NAK FS Inte Constant. NINFO PAM Func NOECHO PAM Inte Constant. No echoing of input characters. NOPAGE PAM Inte Constant. No auto-paging of output. NOSCROLL VTLI Inte Constant. NOTERMECHO PAM Inte Constant. No echoing of terminators. OPENAPPEND PAM Proc OUTFILENAME PAM Func PAM PAM Func Result is a reference to the environment information relating to command parameters. PAM INFILE PAM Inte Constant. PAM KEEPCASE PAM Inte Constant. PAM MAJOR PAM Inte Constant. PAM NEWGROUP PAM Inte Constant. PAM NODEFAULT PAM Inte Constant. PAM OUTFILE PAM Inte Constant. PERMIT PAM Proc PHEX UTIL Proc Print X as 8 hex digits PHEX1 UTIL Proc Print X as single hex digit PHEX2 UTIL Proc Print X as 2 hex digits PHEX4 UTIL Proc Print X as 4 hex digits PI MATH real Constant. PI2 MATH real Constant. PI*2 PIO2 MATH real Constant. PI/2 PIO4 MATH real Constant. PI/4 POP FRAME VTLI Proc PRINT LINE UTIL Proc Print string followed by a newline on current output stream. PROCESS PARAMETERS PAM Proc Parses the string PARM (which will usually be derived from CLIPARAM) according to the definitions previously established by the DEFINE PARAM routines, and sets up values accordingly. PUSH FRAME VTLI Proc QUOTE PAM Proc RDTE FS Byte Constant. RDY FS Inte Constant. READ LINE UTIL Proc Read line from current input stream to string S; leading spaces are not skipped; the terminating newline is read but not included in the string. REFNAME DICT Func Result is address of cell associated with name S in dictionary D. RELEASE UTIL Proc RENAME PAM Proc REVERSE VTLI Inte Constant. RHEX UTIL Proc Read hex number to X, skipping leading spaces and newlines. RSAP FS Byte Constant. RT VTLI Inte Constant. SCREENMODE VTLI Inte notermecho+nopage+specialpad SCROLL VTLI Proc SET FRAME VTLI Proc Define dimensions of current frame (TOP,LEFT from 0). SET MODE VTLI Proc Set current frame mode attributes to M as selection (sum) of NOSCROLL,FREEZE. SET SHADE VTLI Proc Set current frame shade attributes to S as selection (sum) of INTENSE etc SET TERMINAL MODE PAM Proc Set terminal mode as specified by M as selection (sum) of flag values given. SET VIDEO MODE VTLI Proc SIN MATH Func SIN H MATH Func SINGLE PAM Inte Constant. Single character input without buffering. SPECIALPAD VTLI Inte Constant. Alternative mode for numeric pad. (Alternative mode for SET VIDEO MODE) STATION FS Shor STOI UTIL Func String to integer STX FS Inte Constant. TAB VTLI Inte Constant. TAN MATH Func TAN H MATH Func TESTSYMBOL PAM Func Result is -1 if no symbol available from terminal; otherwise result is the ordinal value of the symbol, which is skipped. TIME UTIL Func Current time in form HH:MM TO LOWER UTIL Proc Convert all upper-case letters to lower. TO UPPER UTIL Proc Convert all lower-case letters to upper. TRANSNAME DICT Proc Set S to name with which REF is associated. TWAIT FS Proc UNDERLINE VTLI Inte Constant. USERNO FS Shor Filestore communication. VDU VTLI WININFO Full-screen frame. VT AT VTLI Proc WIN VTLI WININFO Current frame. WININFO VTLI Reco Top, Rows, Left, Cols, Row, Col, Fun, Mode: Byte. @End(FileExample)