1 ! ! G R A D Z E 10 ! NO COPYRIGHT Written by Dr. John S. Abma, Professor of Psychology and Coordinator, Academic Computing, Wittenberg Univeristy, Springfield, Ohio 45501. Neither Wittenberg University nor the author assumes responsibility for the proper or improper use of this program, expressed or implied. 20 ! Written July, 1978 Runs under RSTS-E version 6C, EDIT 03 100 ! THIS PROGRAM WILL ZERO THE FILE 'GRADS.FIL' CREATED BY THE PROGRAM 'GRADS .BAS' OR 'GRADS.BAC' (IF COMPILED) 300 ! Channel #1 is RECORD I/O, two logical records per record for purposes of zeroing. Then the first logical record (256%) is initialized for the header record in the program GRADS.BAS 400 ! VARIABLES USED B$ RECORD NUMBER, INITIALIZED TO 0 IN THIS PROGRAM. B% ZERO, TO INITIALIZE B$ D$ OFFSET VARIABLE D1$ LOGICAL RECORD, INITIALIZED TO 'ZZZZ' IN THIS PROGRAM. I$ OFFSET MULTIPLIER IN "GRADS.BAS" PROGRAM. INITIALIZED TO 1 HERE I% DUMMY LOOPING VARIABLE, ALSO SETS I$ TO 1 O$ USER INPUT; WILL ZERO ONLY IF "Y" IS LEFT LETTER OF INPUT. R% RECORD NUMBER BEING ZEROED VARIABLE 800 ! NO FUNCTIONS OR SUBROUTINES 1000 ! NO ERROR HANDLING 1010 PRINT ' This is GRADZE When run, it will ZERO the file named' \ PRINT '"GRADS.FIL" 1015 PRINT \PRINT 'REALLY WANT TO ZERO "GRADS.FIL"? It contains all the records' \ PRINT 'of the graduates of your department, including mailing labels.' \ PRINT 'You will now get a chance to abort the zero operation.' \ PRINT \INPUT'TYPE Y TO REALLY ZERO, ANYTHING ELSE TO ABORT';O$ \ GOTO 32760 IF LEFT(O$,1%)<>'Y' 1020 OPEN 'GRADS.FIL' AS FILE #1%, FILESIZE 100% \ FOR R%=1% TO 100% \ FOR I%=0% TO 1% \ GET #1% RECORD R% \ FIELD #1%, I%*256% AS D$, 256% AS D1$ \ LSET D1$='ZZZZ' \ PUT #1% RECORD R% \ NEXT I% \ NEXT R% ! The logical records are set to 'ZZZZ' to permit correct sorting of names in the main program, GRADS.BAS 1030 I%=1% \ GET #1% RECORD 1% \ FIELD #1%, 2% AS B$, 2% AS I$ \ LSET B$=CVT%$(B%) ! B% IS 0% 1040 LSET I$=CVT%$(I%) \ PUT #1% RECORD 1% \ CLOSE #1% ! Initializes the header record in main program, GRADS.BAS 1050 PRINT \PRINT 'The file "GRADS.FIL" was ZEROED.' \ GOTO 32767 32760 PRINT \PRINT ' The file "GRADS.FIL" was NOT ZEROED.' 32767 END