%ZRS ;RESTORE VALIDATION ROUTINES FROM DISK FILE (SAMPLE PROGRAM) K W !!!,"RESTORE VALIDATION ROUTINES (SAMPLE PROGRAM)",! S DEV=2 D R !,"DRIVE (DEFAULT=B): ",DRV I DRV="" S DRV="B" W "(B)" I DRV'?1U W !,"ENTER THE LETTER OF THE DESIRED DRIVE" G D E R !!,"FILE NAME: ",FIL I FIL="" G END D OPEN W !,"DISK FILE ",DRV,":",FIL," OPENED" D RSTOR G E END D CLOSE K OK,DEV,FIL,DRV Q ;EXIT ; RSTOR S %Q=0 S TYP="ROUTINE" D READ S TTL=%TP S DAT=%TP D READ W !!,TYP," SAVED ",DAT W !,"TITLED: ",TTL,! K DAT,TTL R !,"ARE YOU SURE (Y/N) ",OK,! Q:OK'="Y" K OK D RTN K %TP,TYP Q ; RTN S AA="X BB I %TP'="""" ZMOVE : ZINSERT %TP" S BB=$P($T(READ)," ",2,999) R2 D READ I %TP="" K AA,BB,CC,I,RTN Q S RTN=%TP X ("ZREMOVE F I=1:0 X AA I %TP="""" ZSAVE @RTN Q") W ?%Q#8*10,RTN S %Q=%Q+1 W:'(%Q#8) ! G R2 ; READ U DEV R %TP U 0 Q OPEN O DEV:(DRV:FIL) U 0 Q ;file open CLOSE U DEV C DEV:0 U 0 Q ;file close ; ; ;ZMOVE ............ Indicates the insertion of the string literal at the end ; of the program lines. ;ZREMOVE .......... Delete all the lines in the partition. ;ZINSERT strling .. Insert a sting literal in the partition as a routine line, ; Next ZINSRT does the same immediately following the ; previous line. ;ZSAVE rnam ...... The program in the partition is saved as a routine with ; the same of rnam. ; ; ;Structure of Sequential Files (BNF) ; ; ::= | | | | | ; ::= ; ::= ; ::= ; ::= ; ::= ; ::= ; ::= ; ::= ... ; ::= ; ::= ; ::= [] ... ; ::= | | ; | | ; ::=