How to Define Your Own Compile List
If the Generate Compile List Utility described in the preceding section does not meet site requirements, you can use alternate methods to build compile lists. The following sample Thoroughbred Basic code is distributed with Dictionary-IV as the IDU006 program. It builds a compile list from a range of scripts. You can modify the code to match your specifications.
0010 REM &REM&
0100 SETERR 9000; ! Set error trap. SETESC 9000; ! Set escape trap. PRINT 'WC', 'CN', ! Clear all windows. "Build List of Scripts to Compile",; C1=UNT; ! Get an available channel. OPEN (C1) "IDDBD"; ! Open the dictionary. FID$=FID(C1), <_> ! Get the FID of dictionary. D=DEC(FID$(20,1)) ! Save disk number.
0200 INPUT @(0,2), 'CL', ! Get "from script" name. "Enter starting script name: ",FROM$; IF CTL=4 ! If F4 key is pressed, GOTO 9000 ! leave the procedure. FI; EXTRACT (C1,KEY="P"+FROM$,DOM=201) ! Move key pointer.
0210 K$=KEY(C1,END=200); ! Get next key. READ (C1); ! Unextract the key. IF K$(1,1) <> "P" ! If not a script record GOTO 200 ! reenter from script name. FI0220 INPUT @(0,3),'CL' ! Get "to script" name. "Enter ending script name: ",TO$ IF CTL=4 ! If F4 key is pressed GOTO 9000 ! leave the procedure. FI; IF TO$=FROM$ AND TO$<>"" ! If "to value" = "from value" TO$=TO$+"~" ! add last value to entry FI; IF TO$="" ! If Enter key pressed TO$="~" ! set to last key value. FI$ IF TO$<FROM$ ! If "to value" < "from value" GOTO 220 ! reenter "to value". FI; FROM$="P"+FROM$, ! Add "P" key prefix to "from TO$="P"+TO$ ! value" and "to value".
0300 CLF$="4GLCL"+FID(0); ! Set compile list file name. CLEAR ERC; ! Clear error control. WHILE ERC=0; ! Erase compile list file on ERASE CLF$, ERC=1; ! all available disks. WEND; SORT CLF$,9,2000,D,0; ! Create compile list file C2=UNT; ! Get an available channel. OPEN (C2) CLF$; ! Open the compile list file. WRITE (C2,KEY=$00$+DAY); ! Write data header record. TO=TIM,T1=FPT(TO)*60, ! Resolve time. TO$=STR(TO:"00")+":"+ STR(T1:"00")+":"+ STR(FPT(T1)*60:"00"); WRITE (C2,KEY=$01$+TO$); ! Write time header record. EXTRACT (C1,KEY=FROM$,DOM=301)! Move key pointer back to ! from record.
0400 K$=KEY(C1,END=9000); ! Get next key. IF K$>TO$ ! If next key is out of range GOTO 9000 ! leave the procedure. FI; IF STL(K$)=9 ! If key is a header record PRINT @(40,0),K$(2),; ! print current script name WRITE (C2,KEY=K$) ! write it to compile list FI; READ (C1,KEY=K$+$FF$,DOM=400);! Move pointer to next! header. GOTO 400 ! Go get next key.
9020 RUN "ID" ! Return to Dictionary-IV menu.From the Script-IV Developer Guide, version 8.9.1. Open this page in the PDF