Title: FILES (RAM) All files are the result of digitized input, at one time or another. Files are written-to, and read-from. Reading from a file is non-destructive, whereas writing to a file may be destructive. Destructiveness depends on whether the process of writing to a file is replacing the given file's current contents, or appending to those contents. Files stored in RAM (random access memory) are not permanent. Any serious loss of power, corruptive power surge, or uncontrolled process may damage, or eliminate the contents of files stored in RAM. It is imperative that this last statement be understood. The practice of writing the contents of RAM files to a less electrically active storage media is highly recommended, i.e. tape, disk, etc. RAM filenames consist of a string of one to six characters, the first of which is a letter. In addition, most RAM files have specific extensions which are suffixed to the filename. These extensions are: .BA BASIC program file .DO ASCII formatted file (a BASIC data file, a TEXT editor file, certain BASIC program files). .CO command file (a machine-language file). NOTE: Most commands which allow you to specify a device (such as LCD, MDM, and so on) default to RAM. In addition, BASIC can often assume the extension of a file from the context of the command. CLOSEfilenumberlist Closes the files OPEN'ed as filenumber. EOF(filenumber) Tests for an end-of-file condition on the RAM file OPEN'ed as filenumber. The function returns a "logical" answer, either "true" (-1) if you have reached the end of the file, or else "false" (0) if you have not reached the end of the file. INPUT#filenumber,variablelist Inputs data sequentially from the RAM file OPEN'ed s filenumber. INPUT$(numericexpression,filenumber) Returns a string of a length given by numericexpression from the RAM file OPEN'ed as filenumber. IPL"filename" Defines the RAM filename as the warm-startup program (that is, the program which runs immediately when you turn on the computer). KILL"filename" Deletes the RAM file filename. You must include the file's extension. LINEINPUT#filenumber,stringvariable Reads a line of text into stringvalue from device named as filenumber. LOAD"RAM:filename",R Loads a BASIC program from RAM. If R is present, BASIC runs the program after it has been loaded. LOADM"RAM:filename" Loads the machine-language program filename from RAM at the address specified when it was saved. MAXFILES Stores the current maximum number of files. You may access MAXFILES line any numeric variable. MERGE"RAM:filename" Merges the lines from the ASCII formatted RAM file called filename with the lines of the current program. NAME"RAM:oldfilename"AS"RAM:newfilename" Renames oldfilename to newfilename. You must include the file's extension. OPEN"RAM:filename"FORmodeASfilenumber Allocates a buffer, filenumber, for a RAM file called filename. Mode can be OUTPUT, specifying data will be written sequentially to the file, starting at the beginning of the file, INPUT, specifying data will be read sequentially from the file, starting at the beginning of the file, or APPEND, specifying that data will be written sequentially to the file, adding records to the end of the file. PRINT#filenumber,expressionlist Writes the values of expressionlist to the RAM file OPEN'ed as filenumber. PRINT#filenumber,USING"format";expressionlist Formats the data in expressionlist and sends it to the RAM file OPEN'ed as filenumber. Format consists of one of more of the following "field specifiers": Prints first string character. PRINT#1,USING"!";"Tandy" Prints 2+n characters from a string. PRINT#1,USING"\\";"Tandy" Print one digit for each #. PRINT#1,USING"#####";5 Inserts the algebraic sign of the number. PRINT#1,USING"+####";-13 Inserts a minus sign either at the beginning or end of negative numbers. PRINT#1,USING"-####";14 Converts leading blanks to leading asterisk blanks. PRINT#1,USING"**#####";145 Inserts a dollar sign to the immediate left of the formatted number. PRINT#1,USING"$$#####";450 Changes leading spaces to asterisks except for the space to the immediate left of the number, where is inserts a dollar sign. PRINT#1,USING"**$###";12 Inserts a decimal point. PRINT#1,USING"#####.##";14.5 Inserts a comma before every three printed digits to the left of the decimal point. PRINT#1,USING"#########,";14432 Prints the number in exponential format. PRINT#1,USING"###.##^^^^";342200 RUN"RAM:filename",R Clears all variables, loads the BASIC program called filename from RAM, and then executes the program. If R is present, BASIC keeps all open files open. If R is omitted, BASIC closes all open file before loading filename. RUNM"RAM:filename" Loads and executes the machine-language program stored as filename. The program must be one executable from the menu, not a BASIC subroutine. In addition, when the program is loaded, BASIC closes all open files. SAVE:RAM:filename",A Writes the current BASIC program to the RAM file called filename. A is optional; if used, BASIC saves the file in ASCII format. Otherwise BSIC saves the file in a compressed binary format (also called tokenized) If filename already exists in RAM, BASIC writes over the old file. SAVEM"RAM:filename",startaddress,endaddress,entryaddress Writes the machine-language program stored from startaddress to endaddress into RAM, under the name filename. Entryaddress is optional; if not present, then BASIC assumes that the program entryaddress is the same as the startaddress. TAB(numericexpression) Writes numericexpression spaces before writing the next data item. Numericexpression spaces between 0 and 255.