USING FILES FROM A BASIC PROGRAM IMMEDIATE MODE COMMANDS (THESE COMMANDS MAY NOT BE IN PROGRAMS) LET f BE A STANDARD RSX11M FILESPECIFIER SAVE f Saves the program in memory to a disk file with a filename f. SAVE will not overwrite an existing version number. REPLACE f Places the program in memory to a disk file with a filename f. REPLACE will overwrite an existing version number. UNSAVE f Deletes a disk file with filename f. The files version number must be specified. OLD f Brings a disk file program into memory. Automatically clears the variable storage area and any old program lines before bringing in the program. APPEND f Merges disk filename f with the program already in memory. RUN[NH] f OLD's the filename f, and RUNs it. CAT [f] Provides a catalog of those programs under your UIC. if no file specifier is present, lists all files with a .BAS type. Wild cards allowed, ie to list all files of all types and versions, CAT *.*;* USING PROGRAM FILES (THESE COMMANDS MUST BE IN PROGRAMS) LET s BE A STRING VARIABLE OR A STRING ENCLOSED IN "" REPRESENTING A STANDARD RSX11M FILESPECIFIER OPEN s AS FILE expression OPEN s FOR INPUT AS FILE expression OPEN s FOR OUTPUT AS FILE expression Before a file is used it must be OPENED. The experession must evaluate to an integer from 1-12. Refer to section 6.2.1 of the BASIC Language Reference Manual for an explanation of the implications of INPUT/OUTPUT. CLOSE expression Closes the OPEN file associatd with the integer gigen by expression. INPUT #expression, variable1,[variable2,variable3,....] expression is the number associated with the desired file. The variable(s) can be string, integer, floating point, or subscripted variables. PRINT #expression[,list] expression is the number associated with the desired file. If lsit is omitted a blank line is inserted into the file. The list contains items to be printed usng the same format as with the PRINT statement. The list can contain any numeric or strin expressions. IF END expression THEN statement IF END expression THEN line number IF END expression GOTO line number The IF END statement allows the program to detect if the end of a sequential file has been reached and to transfer control to some other line number when this occurs. expression is the number of the file. DIM #integer1, array[=integer2] VIRTUAL ARRAYS can be used just like a normal array except that before using one an OPEN statement and a DIM # statement must be execuited. PRINT #, and INPUT # statements are not used with VIRTUAL ARRAYS. integer1 is the constant number associated with the file. The array is a 1 or 2 dimensioned array with the same format as in the DIM statement. integer2 is a constant that specifies the maximum length of a string array (1-256). If omitted it defaults to 16. NAME string1 TO string2 Changes the name of a file with a file name given by string1 to a filename given by string2. KILL s KILL deletes the file given by the filespecifier s.