Sharp OZ-707 Operation Manual - Page 36
Program 3, Adding Data to a Sequential File, Program Execution
UPC - 074000012141
View all Sharp OZ-707 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 36 highlights
Program 3 - Adding Data to a Sequential File 110: DIM AD$(O} 120: OPEN "E:FOLKS" FOR APPEND AS #22 130: REM ADD NEW ENTRIES TO FILE 140: CLS 116500~· INPUT "NAME?";NA$ IF NA$ = "00" THEN 230: REM 00 EXITS INPUT LOOP 170: INPUT "ADDRESS?";AD$(O} 180: INPUT "BIRTHDAY?";BI$ 190: PRINT #22,NA$ 200: PRINT #22,AD$(0} 210: PRINT #22,BI$ 220: GOTO 140 230: CLOSE #22 Input 00 in answer to the question NAME? in line 150 to cause the program to jump out of the input loop in line 160. The REM statement can be used to write programming notes to yourself. This brief introduction to programming should serve to illustrate the exciting programming possibilities of your new Card. Program Execution More than one program can be stored in this Card if the memory capacity is not exceeded. Execute the second or subsequent program using one of the following: 1. the RUN command: RUN line number 1ENTER I 2. the GOTO command: GOTO line number 1ENTER 1 Execution begins from the specified line number. If a label such as *AB is entered in the program, the program can be executed by entering RUN*AB 1ENTER I. The following lists the differences between the variables and status when a program is executed using the GOTO and RUN commands. Execution using RUN Execution using GOTO • Clears the WAIT setting. • Clears the USING format. • Clears array and simple variables. • Clears double-precision operation mode and variable specifications. • Initializes the DATA statement for the READ statement. • Clears the PRINT=LPRINT setting. • Closes all the files • Clears the position set by LOCATE or GCURSOR. • Clears the error trap function. • Clears ERN and ERL variables. • Retains the WAIT setting. • Retains the USING format. • Retains array and simple variables. • Retains double-precision operation mode and variable specifications. • Does not initialize the DATA statement for the READ statement. • Retains the PRINT=LPRINT setting. • Does not close all the files. • Retains the position set by LOCATE or GCURSOR. • Retains the error trap function. • Retains ERN and ERL variables. Note: When the program is executed using the RUN command, the variables for data are cleared. (Fixed variables are retained.) To retain the data, execute using the GOTO command. 60 61