C451 LIB9C451MIN LIB=&GCREATOR BASc=z0CREATOR DOC8%CREATOR OVLBgCREATOR OVR6AMENU BASP R451 LIB\ &/REKEY BAShREPORTORBAS~=!REPORTOROVL=$21 DEF FNPH$(X%)=CHR$(X%+128):DEF FNUH(X$)=ASC(X$)-128 100 PRINT 110 PRINT"Enter data............................................Depress E" 120 PRINT"Look up a record......................................Depress L" 130 PRINT"Scan all records......................................Depress S" 140 PRINT"Update a record.......................................Depress U" 150 PRINT"Delete a record.......................................Depress D" 160 PRINT"Exit the program......................................Depress X" 170 PRINT"Initialize the file...................................Depress I" 180 GET 2,1:PRINT" CURRENT NUMBER OF RECORDS IN FILE=";CVI(KP$);:IF CVI(KP$)<1 THEN PRINT"PLEASE INITIALIZE!":ELSE PRINT 185 PRINT"Please depress the key corresponding to your choice." 1000 PRINT CLS$:REM*BEGIN ENTRY 1005 FC=FC+1 10000 REM*BEGIN FILE LOOK UP 10010 GOSUB 27000:'TRY TO FIND THE RECORD 10200 GOSUB 28000:'UNPACK THE FIELDS 10800 GOSUB 29000:'DISPLAY RECORD IF KEY FIELD MATCHES 11000 REM*BEGIN FILE LOOK UP 11010 GOSUB 27000:'TRY TO FIND THE RECORD 11200 GOSUB 28000:'UNPACK THE FIELDS 11800 GOSUB 29000:'DISPLAY RECORD IF KEY FIELD MATCHES 11810 UF$="":PRINT:PRINT"What field number do you want to update? "; 11820 UX$=INKEY$:IF UX$>="0" AND UX$<="9" THEN PRINT UX$;:UF$=UF$+UX$:GOTO 11820 ELSE IF UX$<>CHR$(13) THEN 11820:ELSE UF=VAL(UF$) 11900 REM*BEGIN OUTPUT* 11998 REM*INSERT CHANGED FIELDS AND SEND TO DISK* 12000 REM*BEGIN RECORD DELETE* 12010 GOSUB 27000:'TRY TO FIND THE RECORD 12200 GOSUB 28000:'UNPACK THE FIELDS 12800 GOSUB 29000:'DISPLAY RECORD IF KEY FIELD MATCHES 12900 REM*DELETE CODE WRITTEN INTO ALL FIELDS* 22000 REM*FIELD TITLES FOR DISPLAY* 25000 IF ERL>35000 AND ERL<36000 THEN RESUME 35000:ELSE IF ERR=6 THEN RESUME NEXT 25001 IF ERR=62 THEN PRINT"YOU DIDN'T INITIALIZE YOUR DATA FILE. DO SO!":FOR I=1 TO 1000:NEXT:RUN 25010 PRINT"ERROR ENCOUNTERED IN LINE";ERL 25015 IF ERR=10 THEN PRINT"You have input a number too large for the field type.":RESUME NEXT 25020 IF ERL<10000 AND ERL>1000 THEN PRINT"You have probably made an error in edit specifications." 25030 PRINT"ERROR NUMBER IS";ERR:CLOSE:END 25999 REM*HASHING ALGORITHM 26000 FOR ZZ=1 TO LEN(ZZ$) 26010 SP=ASC(MID$(ZZ$,ZZ,1)):X#=X#+ZZ*(SP+1/SP) 26020 NEXT 26030 IF X#<1E+17 THEN X#=X#*X#:GOTO 26030 26035 SP=ASC(ZZ$)+ASC(RIGHT$(ZZ$,1)):SP=SP-10*(INT(SP/10)):SP=SP+4:X$=STR$(X#):RP=VAL(MID$(X$,SP,4)):X#=0 27000 REM*LOOK FOR THE RECORD* 27020 'NOW WE HAVE INPUT THE KEY FIELD 27030 ZZ$=KF$:GOSUB 26000:KP=RP:'GO TO HASHING ROUTINE AND GET POSITION 27999 REM*UNPACK FIELDS IN RECORD* 28998 RETURN 28999 REM*DISPLAY FOUND RECORD* 29000 PRINT CLS$;:CL=1 29020 READ R$:CX=LEN(G$(I)) 29021 IF CX>10 THEN IF MID$(G$(I),CX-9,10)=" " THEN CX=CX-10:GOTO 29021 29022 IF CX19 THEN GOSUB 41010:GOTO 29024 29026 IF (LC<40 AND LEN(R$)+LEN(G$(I))+37<80) THEN PRINT TAB(40);"#";I;"|";R$;"|";G$(I);:ELSE PRINT:CL=CL+1:GOTO 29024 29030 NEXT:RESTORE:PRINT 29930 IF AN$="S" OR AN$="s" THEN RETURN 29940 PRINT:PRINT"IS THIS IT? (DEPRESS Y IF SO, ANY OTHER IF NOT)"; 29950 AN$=INKEY$:IF AN$="" THEN 29950:ELSE PRINT CHR$(13);STRING$(60,32);:PRINT CHR$(13);:IF AN$<>"Y" THEN GOSUB 27040:GOSUB 28000:GOTO 29000 29960 RETURN 29999 REM*NUMERIC FIELD EDIT CHECK SUBROUTINE* 30000 CD=INSTR(CD$,CHR$(32)):IF CD>1 THEN CD$=LEFT$(CD$,CD-1)+MID$(CD$,CD+1):GOTO 30000:ELSE IF CD=1 THEN CD$=MID$(CD$,2):GOTO 30000 30005 FOR ZZ=1 TO LEN(CD$) 30010 IF MID$(CD$,ZZ,1)<"0" OR MID$(CD$,ZZ,1)>"9" THEN IF MID$(CD$,ZZ,1)<>"." AND MID$(CD$,ZZ,1)<>"-" THEN E=1 30020 NEXT:IF E THEN RETURN 30030 CD=INSTR(CD$,"-"):IF CD>0 AND INSTR(CD+1,CD$,"-")>0 THEN E=1:RETURN:ELSE IF (CD>0 AND CD<>1) THEN E=1:RETURN 30040 CD=INSTR(CD$,"."):IF CD>0 AND INSTR(CD+1,CD$,".")>0 THEN E=1:RETURN 30050 RETURN 30999 REM*ALPHA FIELD EDIT CHECK* 31000 FOR ZZ=1 TO LEN(CD$) 31010 IF MID$(CD$,ZZ,1)<="9" AND MID$(CD$,ZZ,1)>="0" THEN E=1 31020 NEXT 31030 RETURN 32000 REM*INITIALIZE* 32010 PRINT"This will erase all previous data, if any.":PRINT"To continue initialization, depress the C key."; 32030 AN$=INKEY$:IF AN$="" THEN 32030:ELSE IF AN$<>"C" THEN RUN 32035 PRINT CLS$:PRINT"This will take a little while. Please be patient." 32060 PUT 2,I 32070 NEXT:LSET KP$=MKI$(1):PUT 2,1:RUN 34999 REM*BEGIN RECORD SCAN* 35001 INPUT"Numeric or alphabetic scan (N/A):";NS$:NS%=ASC(NS$):NS%=NS% AND 95:NS$=CHR$(NS%):IF NS$<>"N" AND NS$<>"A" THEN 35001 35002 INPUT"Smallest (numeric or alpha) to display:";SM$ 35003 INPUT"Largest (numeric or alpha) to display:";LA$ 35004 INPUT"Should I delay after displaying each record (Y/N)?";DY$:NS%=ASC(DY$):NS%=NS% AND 95:DY$=CHR$(NS%):IF DY$<>"N" AND DY$<>"Y" THEN 35004 35050 GOSUB 28000:'UNPACK THE RECORD 35060 IF NS$="A" AND (G$(NS)LA$) THEN 35965 35070 IF NS$="N" AND (VAL(G$(NS))VAL(LA$)) THEN 35965 35960 GOSUB 29000:'DISPLAY RECORD 35965 IF DY$="Y" THEN 35970 ELSE 35990 35970 FOR J=1 TO 2000:NEXT:'WAIT BEFORE DISPLAYING NEXT RECORD 36000 REM*FIELD LENGTHS AND FIELDING FILE* 36820 FIELD #1,CD% AS DD$,F%(ZZ) AS F$(ZZ):CD%=CD%+F%(ZZ):NEXT:RETURN 38000 CLOSE:NEW 40000 G1=INSTR(G$(UF),"MORE"):IF G1>0 THEN G%=CINT(VAL(G$(UF))+VAL(G$)):G$(UF)=MID$(STR$(G%),FIX(2+SGN(G%)/2)):RETURN 40010 G1=INSTR(G$(UF),"LESS"):IF G1>0 THEN G!=CSNG(-VAL(G$(UF))+VAL(G$)):G$(UF)=MID$(STR$(G!),FIX(2+SGN(G!)/2)):RETURN 40020 G1=INSTR(G$(UF),"+"):IF G1>1 THEN G%=CINT(VAL(G$(UF))+VAL(G$)):G$(UF)=MID$(STR$(G%),FIX(2+SGN(G%)/2)):RETURN 40030 G1=INSTR(G$(UF),"-"):IF G1>1 THEN G!=CSNG(-VAL(G$(UF))+VAL(G$)):G$(UF)=MID$(STR$(G!),FIX(2+SGN(G!)/2)):RETURN 40040 G1=INSTR(G$(UF),"*"):IF G1>0 THEN G%=CINT(VAL(G$(UF))*VAL(G$)):G$(UF)=MID$(STR$(G%),FIX(2+SGN(G%)/2)):RETURN 40050 G1=INSTR(G$(UF),"/"):IF G1>0 THEN G%=CINT(VAL(G$)/VAL(G$(UF))):G$(UF)=MID$(STR$(G%),FIX(2+SGN(G%)/2)):RETURN 40100 RETURN 40500 G3=0:G2=INSTR(G$(UF),"RO"):IF G2 THEN G3=VAL(MID$(G$(UF),G2+2)) 40510 G1=INSTR(G$(UF),"LESS"):IF G1>0 THEN G#=CDBL(-VAL(G$(UF))+VAL(G$)):G$(UF)=MID$(STR$(G#),FIX(2+SGN(G#)/2)):GOTO 40570 40520 G1=INSTR(G$(UF),"+"):IF G1>1 THEN G#=CDBL(VAL(G$(UF))+VAL(G$)):G$(UF)=MID$(STR$(G#),FIX(2+SGN(G#)/2)):GOTO 40570 40530 G1=INSTR(G$(UF),"-"):IF G1>1 THEN G#=CDBL(-VAL(G$(UF))+VAL(G$)):G$(UF)=MID$(STR$(G#),FIX(2+SGN(G#)/2)):GOTO 40570 40540 G1=INSTR(G$(UF),"*"):IF G1>0 THEN G#=CDBL(VAL(G$(UF))*VAL(G$)):G$(UF)=MID$(STR$(G#),FIX(2+SGN(G#)/2)):GOTO 40570 40550 G1=INSTR(G$(UF),"/"):IF G1>0 THEN G#=CDBL(VAL(G$)/VAL(G$(UF))):G$(UF)=MID$(STR$(G#),FIX(2+SGN(G#)/2)):GOTO 40570 40560 G1=INSTR(G$(UF),"MORE"):IF G1>0 THEN G#=CDBL(VAL(G$(UF))+VAL(G$)):G$(UF)=MID$(STR$(G#),FIX(2+SGN(G#)/2)) 40570 IF G2<1 THEN RETURN 40580 G#=CDBL(VAL(G$(UF))) 40590 IF G3 THEN FOR G2=1 TO G3:G#=G#*10:NEXT:G#=FIX(G#+.500001#*SGN(G#)) 40600 IF G3 THEN FOR G2=1 TO G3:G#=G#/10:NEXT:ELSE G#=FIX(G#+.500001#*SGN(G#)) 40610 G$(UF)=MID$(STR$(G#),FIX(2+SGN(G#)/2)):RETURN 41000 IF CL<20 THEN RETURN 41010 PRINT:PRINT"THERE ARE MORE FIELDS! HIT ANY KEY TO SEE THE REST:"; 41015 Y$=INKEY$:IF Y$="" THEN 41015:ELSE PRINT CLS$:CL=0:RETURN :PRINT"THERE ARE MORE FIELDS! HIT ANY KEY TO SEE THE REST:"; 41015 Y$=INa PH$(X%)(X%): UH(X$)(X$)ad6bn"Enter data............................................Depress E"}bx"Look up a record......................................Depress L"b"Scan all records......................................Depress S" c"Update a record.......................................Depress U"Rc"Delete a record.......................................Depress D"c"Exit the program......................................Depress X"c"Initialize the file...................................Depress I"Ed ,:" CURRENT NUMBER OF RECORDS IN FILE=";(KP$);: (KP$) "PLEASE INITIALIZE!":: d"Please depress the key corresponding to your choice."d CLS$:*BEGIN ENTRYdFCFCd' xid' `md0* Hqd* xid+ `md. Hqe".UF$""::"What field number do you want to update? ";}e,.UX$: UX$"0" UX$"9" UX$;:UF$UF$UX$: ,. : UX$( ) ,.:: UF(UF$)e. xie/ `me2 HqeU:ea   ::  fa > "YOU DIDN'T INITIALIZE YOUR DATA FILE. DO SO!": I ::>fa"ERROR ENCOUNTERED IN LINE";fa  "You have input a number too large for the field type.": fa '  "You have probably made an error in edit specifications."fa"ERROR NUMBER IS";:: ge ZZ (ZZ$)6geSP((ZZ$,ZZ,)):X#X#ZZ(SPSP)G1(G$(UF),"LESS"): G1 G#((G$(UF))(G$)):G$(UF)((G#),((G#))): zqHG1(G$(UF),"+"): G1 G#((G$(UF))(G$)):G$(UF)((G#),((G#))): z\rRG1(G$(UF),"-"): G1 G#((G$(UF))(G$)):G$(UF)((G#),((G#))): zr\G1(G$(UF),"*"): G1 G#((G$(UF))(G$)):G$(UF)((G#),((G#))): zsfG1(G$(UF),"/"): G1 G#((G$)(G$(UF))):G$(UF)((G#),((G#))): zsspG1(G$(UF),"MORE"): G1 G#((G$(UF))(G$)):G$(UF)((G#),((G#)))sz G2 sG#((G$(UF)))s G3 G2 G3:G#G# ::G#(G#(G#))t G3 G2 G3:G#G# ::: G#(G#(G#))";A;" OR UF<0 THEN PRINT";Q$;"INVALID FIELD.";Q$;":GOTO 11810": #,"11850 IF UF=0 THEN";SL: #,"11860 PRINT CHR$(13);STRING$(63,32);CHR$(13);"l  #,"11865 ON UF GOSUB ";l TZ A: #,((D%(TZ) ),);",";: TZ: #,((D%(A) ),): #,"11870 IF UF<>";KF;" THEN 11900 ELSE ZZ$=STRING$(F%(";KF;"),32):LSET ZZ$=G$(";KF;8m RS #,"):FIELD #1,";RS;" AS DL$:LSET DL$=STRING$(";RS;",250):PUT 1,RP:LSET KP$=MKI$(-RP):PUT 2,KP:GOSUB 26000:KP=RP"m" RS #,"):FIELD #1,255 AS DL$,1 AS DX$:LSET DL$=STRING$(255,250):LSET DX$=CHR$(250):PUT 1,RP:LSET KP$=MKI$(-RP):PUT 2,KP:GOSUB 26000:KP=RP"n, #,"11999 FOR I=1 TO ";A;":LSET F$(I)=G$(I):NEXT :PUT 1,RP:G$=";Q$;Q$;":GOTO 11200": #,"27010 PRINT CLS$:GOSUB ";D%(KF) ;":KF$=STRING$(F%(";KF;"),32):LSET KF$=G$(";KF;")"n6 #,"27040 KP=KP+1:IF KP>";MS;" OR KP<2 THEN KP=1:REM CIRCULATE AROUND"yo@ #,"27050 GET 2,KP:RP=CVI(KP$):IF RP<-1 THEN 27040:ELSE IF RP=0 THEN ERROR 62:ELSE IF RP=-1 THEN PRINT";Q$;"RECORD NOT FOUND.";Q$;":FOR I=1 TO 2000:NEXT I:RUN"oJ #,"27055 GET 1,RP:IF LEFT$(F$(";KF;"),LEN(ZZ$))=ZZ$ THEN RETURN:ELSE 27040"oT:6p^LNLN : #,LN;"ZZ$=STRING$(F%(";KF;"),32):LSET ZZ$=G$(";((KF),);"):GOSUB 26000:KP=RP"uph #,"26040 RP=";((MS),);"*RP/9999:RP=FIX(RP):RETURN"BqrLNLN : #,LN;"REM*LOOK FOR RECORD SPACE":LNLN : #,LN;"GOSUB ";LN ;":GOTO";LN<:LNLN : #,LN;"KP=KP+1:IF KP>";MS;" OR KP<2 THEN KP=2": #,"11890 KP=KP+1:IF KP>";MS;" OR KP<2 THEN KP=2"q| #,"11895 GET 2,KP:IF CVI(KP$)<>-1 THEN 11890": #,"11896 GET 2,1:RP=CVI(KP$)+1:LSET KP$=MKI$(RP):PUT 2,1:LSET KP$=MKI$(RP):PUT 2,KP"rLNLN : #,LN;"GET 2,KP:RP=CVI(KP$):IF RP>0 THEN";LN :LNLN : #,LN;"IF RP<-1 THEN RETURN":LNLN : #,LN;"IF RP=0 THEN ERROR 62":LNLN : #,LN;"RETURN":LNLN : #,LN;"FOR K=1 TO ";ArLNLN : #,LN;"LSET F$(K)=G$(K):NEXT "hsLNLN : #,LN;"IF RP<-1 THEN PUT 1,ABS(RP):LSET KP$=MKI$(ABS(RP)):PUT 2,KP:ELSE PK=KP:GET 2,1:KP=1+CVI(KP$):LSET KP$=MKI$(KP):PUT 2,PK:PUT 1,KP:PUT 2,1"s CLS$;"Now we are almost done. We need to ask the operator if he is":"done with entry or update. You may choose the message you wish."gt"The operator's input will be limited to a single key depression.":"I would suggest something of the form:"t"Are you finished with entry? (Y/N) Enter your choice below:": TM$t"If the operator is NOT done, what should the reply be?";=uND$: ND$"" :: CV$ND$: :ND$CV$: ND$: ND$" " xu"If the operator IS done, what should the reply be?";";Q$;ND$;Q$;" THEN PRINT";Q$;"PLEASE ANSWER ";ND$;" OR ";ID$;Q$;":GOTO";BL:LNLN : #,LN;"FOR I=1 TO ";A;":G$(I)=";Q$;Q$;":NEXT :FC=0:PRINT CLS$:UF=0:G$=";Q$;Q$;":GOTO 1000"w"Do you want to cut down on remarks in the generated program?":"Please answer Y or N: "; xCV$: CV$"" :: : CV$mx CV$"Y" "I",,"C451MIN.LIB":: CV$"N" "I",,"C451.LIB":: x CLS$;"WAIT A MOMENT WHILE I FINISH YOUR PROGRAM."x& () lx0 #,A$x: S3% (A$)/u (A$)y &yD S4% (A$)y (A$)| &NyN S1% (A$)@ (A$)4 &yX S2% (A$)4 (A$)( &yb #,A$: &ylXzv CLS$;"Your program has been written and saved on the specified drive.":"You may now load it and run it, if you wish. Remember, your":"data file does NOT exist until you initialize it!"z"Thanks for running the CREATOR!": I : I:zz"ERROR NUMBER";;"AT LINE";: {"REMEMBER, ALL FIELDS ARE STRINGS WITHIN THE ARRAY G$()."{"TO PERFORM ARITHMETIC ON A FIELD, IT IS NECESSARY TO TAKE ITS":"VALUE FIRST, WITH THE VAL COMMAND. FOR EXAMPLE, TO PRINT THE":"SUM OF FIELDS 1,2, AND 3 YOU WOULD TYPE THE COMMAND LINE"{"VAL(G$(1))+VAL(G$(2))+VAL(G$(3))"|:"Now, type in a command line which will tell me what operations":"I should perform. Please don't type more than 240 characters.":"HIT THE RETURN WHEN YOU ARE DONE."|:"COMMAND LINE:";: CV$: (CV$) "TOO LONG! TRY AGAIN!": :: (CV$) 7}K:JK:J: I (CV$): (CV$,I,)Q$ J(J)E}  J  } (CV$,I,)")" KK:: (CV$,I,)"(" JKJK}  I: JKK "MISMATCHED PARENTHESES SOMEWHERE. PLEASE TRY AGAIN."~* J "MISMATCHED QUOTATION MARKS (";Q$;") IN YOUR COMMAND. PLEASE TRY AGAIN."9~4 J (JKK) p~>"What title should I use for this data:";: TI$~H (TI$,Q$) "NO QUOTATION MARKS ALLOWED.": >RJLJL : #,JL;"CL=CL+1:GOSUB 41000": #,JL;"PRINT CHR$(124);";Q$;TI$;Q$;";CHR$(124);"\"If this field is numeric, you may use a formatted print.":"If it is not, or you do not wish to print it in a formatted":"way, you need not. DO YOU WISH TO USE A FORMATTED PRINT (Y/N)"fTI$: TI$"" f:: TI$"N" p TI$"Y" \z "Number of places to the left of the decimal point=";NL$: (NL$) (NL$) "Illegal (0-16 only).": z& "Number of places to the right of the decimal point";NR$: (NR$) (NL$)(NR$) "Illegal number of places or illegal total places (0-16).": P"Do you want to use commas (Y/N): ";NC$: NC$"" :: NC$"N" NC$"Y"  NC$́TI$"USING"Q$((NL$),"#"): NC$"Y" TI$TI$","ꁶ (NR$) TI$TI$"."TI$TI$((NR$),"#")Q$";":CV$TI$CV$3 #,JL;"PRINT ";CV$~"Your commands have been accepted. Ready for the next command.": #")Q$";":CV$TI$CV$3 #,JL;"PRINT ";CV$~"Yoa:CREATOR; WRITTEN ON 1/16/80 BY BRUCE W. TONKIN.b:ADAPTED FOR CP/M AND MICROSOFT BASIC 5.01 ON 5/11/80b:FOR 4.51 ON 3/18/81, AND FOR MODEL III ON 2/20/83, FOR CP/M AND MBASIC 4.51/5.2+ AGAIN ON 3/23/83; FOR 48K CP/M ON 7/2/83 WITH OVERLAYS; THIS IS THE FIRST OVERLAYjc:THIS IS PUBLIC DOMAIN SOFTWARE AND MAY NOT BE SOLD OR INCORPORATED IN ANY COMMERCIAL SOFTWARE WITHOUT THE EXPRESS PERMISSION OF THE AUTHORrc:|c cFX: (CV$) c II (CV$):CV%((CV$,II,)): CV%" FX FX:: CV%" FX FXd( CV%Z FX CV%CV% _3d2(CV$,II,)(CV%): II:|d CLS$;"Which field is the key field? Input the field number:";: KFd #,"35005 GET 2,1:KP=CVI(KP$):FOR K=1 TO KP:RP=K:GET 1,K": #,"35010 IF F$(";KF;")>CHR$(249) THEN 35990"ve #,"35000 PRINT CLS$:INPUT";Q$;"Field number to scan (1-";A;")";Q$;";NS:IF NS<1 OR NS>";A;" THEN 35000": #,"35990 NEXT K:GOTO";SLeLN: QR KF:FTFT(F$(QR)): QR: : *f CLS$;"Now we must describe the input prompts the operator will see,":"the edits to be performed, and the kind of data for each field.":"To do this, we will ask a series of questions about each field."g"To the question KIND OF DATA, the possible responses are:":"N..............numeric data, not packed, stored as characters."g"PH..............packed half-precision, stored as one character.":"PI............packed integer data, stored as two characters."h"PS........packed single precision data, stored as 4 characters.":"PD........packed double precision data, stored as 8 characters."h"C.........................character data, stored as characters.":"To the PROMPT question, type the message the operator will see."ri"To the BAD INPUT IF question, type as many edits as you wish of":"the form: >999 <";Q$;"A";Q$;" NOT NUMERIC NO ENTRY":"LENGTH>9 NOT ALPHA CONTAINS";Q$;"Z";Q$;" >=4 <>6"i"Note the quotes around alpha edits. Depress any key for more:";iPZ$: PZ$"" j  CLS$;"To the question ERROR MESSAGE, type the message the operator":"will see if that error is made. You may signal completion of":"edits for any field by just depressing the enter key. To repeat"j"these directions, type HELP. NOW DEPRESS ANY KEY TO CONTINUE:";k PZ$: PZ$""  :: :Jk* I A:I$((I),):"FIELD #";I;" LENGTH=";:L(F$(I)): Lk4P$"":"PROMPT:";: P$: P$"HELP" : 4k>"Should the prompt and reply be on the same line (Y/N):";NY$:CV$NY$: :NY$CV$: CV$"Y" NY$";":: NY$""ulHK$"":"KIND OF DATA:";: L L L L "C":K$"C":: K$:CV$K$: :K$CV$: K$"HELP" : HlR K$"PH" K$"PI" K$"PS" K$"PD" K$"C" K$"N" fl\"INVALID DATA TYPE: USE PH, PI, PS, PD, N OR C ONLY!": Hbmf (K$"PH" L) (K$"PI" L) (K$"PS" L) (K$"PD" L) (K$"N") (K$"C") zmp"INCORRECT LENGTH FOR VARIABLE TYPE!": HnzLNLN : #,LN;"PRINT";Q$;P$;Q$;NY$:BLLN: K$"C" #,BL;"IF UF<>0 AND G$=";Q$;Q$;" THEN G$=G$(";I$;")"nLNLN : #,LN;"LINE INPUT G$(";I$;")";:D%(I)LN: OO$"N" #," ":: #,":IF G$(";I$;")=";Q$;OT$;Q$;" THEN";SLn K$"PI" K$"PH" n #,LN;"IF UF THEN GOSUB 40000":S1%n K$"PS" o #,LN;"IF UF THEN GOSUB 40500":S2%'o K$"PD" To #,LN;"IF UF THEN GOSUB 40500":S2%io K$"PI" oLNLN : #,LN;"IF ABS(VAL(G$(";I$;")))>32767 THEN PRINT";Q$;"NUMBER OUT OF RANGE. MUST BE FROM -32767 TO 32767.";Q$;":GOTO";BLp K$"PH" pLNLN : #,LN;"IF ABS(VAL(G$(";I$;")))>127 THEN PRINT";Q$;"NUMBER OUT OF RANGE. MUST BE FROM -127 TO 127.";Q$;":GOTO";BLp K$"PI" K$"PH" LNLN : #,LN;"IF G$(";I$;")=";Q$;"0";Q$;" THEN";LNp K$"PI" K$"PH" nqLNLN : #,LN;"IF INT(VAL(G$(";I$;")))<>VAL(G$(";I$;")) THEN PRINT";Q$;"MUST BE A WHOLE NUMBER.";Q$;":GOTO";BLqBI$"":"Bad input if:";: BI$:CV$BI$: :BI$CV$: BI$"" q (BI$,"LENGHT") "MISSPELLED WORD":  r$ BI$"HELP" : Dr."Error message:";: EM$: EM$"HELP" : . s8"Is this a fatal error or a non-fatal error? A fatal error":"simply means the operator must try inputting this field until":"the input is correct; a non fatal error means the error message"s="will be printed as a warning, but the (possibly) erroneous":"input will be accepted. Depress F if the error is FATAL, or any":"other key, if not a fatal error: ";tBFE$: FE$"" B:: CV$FE$: :FE$CV$: FE$: FE$"F" FE$":GOTO"(BL):: FE$" "?tL (BI$,"NOT NUMERIC") S3%: jtV (BI$,"NOT ALPHA") S4%: t : (BI$,"NO ENTRY") ~t` (BI$,"CONTAINS")  : (BI$,"LENGTH")  : ujLNLN : #,LN;"CD$=G$(";I$;"):E=0:GOSUB 30000:IF E=1 THEN PRINT";Q$;EM$;Q$;FE$: {utLNLN : #,LN;"CD$=G$(";I$;"):E=0:GOSUB 31000:IF E=1 THEN PRINT";Q$;EM$;Q$;FE$: u~LNLN : #,LN;"IF LEN(G$(";I$;"))=0 THEN PRINT";Q$;EM$;Q$;FE$: uFH(BI$,Q$): FH "YOU FORGOT QUOTES.":  v FH vFH$(BI$,FH,):LNLN : #,LN;"IF INSTR(G$(";I$;"),";Q$;FH$;Q$;")>0 THEN PRINT";Q$;EM$;Q$;FE$:FH: v"SYNTAX ERROR. CONTAINS should not be set off by quotes.": 6wFH(BI$,"LENGTH"):LNLN : #,LN;"IF LEN(G$(";I$;"))";(BI$,FH);" THEN PRINT";Q$;EM$;Q$;FE$:FH: tw (BI$,"<") (BI$,">") (BI$,"=")  : w"SYNTAX ERROR. Repeat command, please.": wC(BI$,Q$): C xLNLN : #,LN;"IF G$(";I$;")";BI$;" THEN PRINT";Q$;EM$;Q$;FE$:FH: hxLNLN : #,LN;"IF VAL(G$(";I$;"))";BI$;" THEN PRINT";Q$;EM$;Q$;FE$:FH: xLNLN : K$"PI" #,LN;"G$(";I$;")=MKI$(VAL(G$(";I$;")))"x K$"PH" #,LN;"G$(";I$;")=FNPH$(VAL(G$(";I$;")))"9y K$"PI" #,|.I;"IF UF<>";I$;" THEN G$(";I$;")=MKI$(VAL(G$(";I$;")))"y  K$"PH" #,|.I;"IF UF<>";I$;" THEN G$(";I$;")=FNPH$(VAL(G$(";I$;")))"y K$"PI" #,`mRL;"G$(";I$;")=STR$(CVI(F$(";I$;")))" z K$"PH" #,`mRL;"G$(";I$;")=STR$(FNUH(F$(";I$;")))"Ez( K$"PS" #,LN;"G$(";I$;")=MKS$(VAL(G$(";I$;")))"z2 K$"PS" #,|.I;"IF UF<>";I$;" THEN G$(";I$;")=MKS$(VAL(G$(";I$;")))"z< K$"PS" #,`mRL;"G$(";I$;")=STR$(CVS(F$(";I$;")))"{F K$"PD" #,LN;"G$(";I$;")=MKD$(VAL(G$(";I$;")))"a{P K$"PD" #,|.I;"IF UF<>";I$;" THEN G$(";I$;")=MKD$(VAL(G$(";I$;")))"{Z K$"PD" #,`mRL;"G$(";I$;")=STR$(CVD(F$(";I$;")))"{d K$"N" K$"C" #,RL`m;"G$(";I$;")=F$(";I$;")"|nRLRL :LNLN : #,LN;"RETURN"::"CREATOR.OVL", ,ALL0|:ERROR HANDLER\|"ERROR NUMBER";;"AT LINE";: RLRL :LNLN : #,LN;"RETURN"::"CREATOR.OVL", ,ALL0|:ERROR HANDLER\|"ERRORa AZa I :: Ib"CREATOR AND REPORTOR ARE TRADEMARKS OF T.N.T. SOFTWARE, INC."bb("34069 HAINESVILLE ROAD, ROUND LAKE IL 60073. THESE PROGRAMS"b2"ARE NOT TO BE SOLD WITHOUT THE EXPRESS WRITTEN PERMISSION OF"b<"T.N.T. SOFTWARE, INC. VIOLATORS WILL BE PROSECUTED!"'cF"IF YOU GOT THIS PROGRAM FROM A FRIEND, AND WANT DOCUMENTATION,"jcP"SEND $10, + $1 POSTAGE & HANDLING, TO T.N.T. SOFTWARE, INC."cZ"A NEWSLETTER IS AVAILABLE FOR $10 PER YEAR IN THE U.S., CANADA,"cd"AND MEXICO (PUBLISHED QUARTERLY). WRITE AND ASK FOR OUR CATALOG."cn8dx" CREATOR AND REPORTOR MENU "::ad" You have the following choices: "d" 1. Write a program using the CREATOR."d" 2. Write a report program using the REPORTOR."d" 3. Run a program or a report."e" 4. Sort a data file."=e" 5. Create or re-create a key file."ge" 6. Quit, and exit to BASIC."::e" Please depress the number of your choice: ";eAN$$()eAN(AN$): AN AN f AN ( );(<, );( );"LOADING THE CREATOR.":"CREATOR.BAS"df AN ( );(<, );( );"LOADING THE REPORTOR.":"REPORTOR.BAS"f AN ( );(<, );( );"EXITING TO OPERATING SYSTEM FOR CHEAPSORT.":f AN ( );(<, );( );"LOADING REKEY.":"REKEY.BAS" g AN Vg ( );(<, );( );:"What's the name of the program to run: ";ug" F$:"LOADING ";F$: F$BAS" g AN Vg ( );(<, );( );:"What's the name10 PRINT"Should this report be on the screen (S), printer (P), or both":PRINT"screen and printer (B)";:INPUT PD$:IF INSTR("SsPpBb",PD$)<1 THEN 10 11 PD$=CHR$(ASC(PD$) AND 95) 15 PRINT"What drive is the data file on (A-P):";:LINE INPUT DR$:IF DR$<"A" OR DR$>"P" THEN 15 17 DF$=DR$+":"+DF$ 18 PRINT"OK, depress any key when the data file is on that drive:"; 19 A$=INKEY$:IF A$="" THEN 19 20 PRINT:PRINT"Are you going to read an index file for a sorted report (Y/N)";:INPUT SR$ 21 IF INSTR("YyNn",SR$)<1 THEN 20: ELSE SR$=CHR$(ASC(SR$) AND 95) 22 IF SR$="N" THEN 29 23 PRINT"Please give me the complete name of your index file. For":PRINT"example, A:MYFILE.INX ";:LINE INPUT SR$ 29 ' 35 IF PD$="S" OR PD$="B" THEN PRINT CLS$ 36 IF SR$<>"N" THEN OPEN"I",2,SR$ 45 DIM CF$(50),T#(50):GOSUB 40000:'DIMENSIONING THE MATRICES WE WILL USE 65 'FOLLOWING ARE THE COLUMN HEADINGS 19990 'PRINTING TOTALS SECTION 30000 'FIELDING THE FILE 30800 TT=0 30810 FIELD#1,(TT) AS DY$,(FF(IX)) AS F$(IX) 30820 TT=TT+FF(IX):NEXT:RETURN 30990 'BEGIN PRINTING THE COLUMN HEADINGS 31000 IF PD$<>"S" THEN LPRINT 31005 IF PD$<>"P" THEN PRINT 31010 READ T:OF%=0:IF MID$(M$,J,1)="M" THEN OF%=LEN(CF$(J))-LEN(H$(J)) 31012 IF PD$<>"P" THEN PRINT TAB(T+OF%);H$(J); 31015 IF PD$<>"S" THEN LPRINT TAB(T+OF%);H$(J); 31020 NEXT:RESTORE 31030 IF PD$<>"P" THEN PRINT:PRINT 31040 IF PD$<>"S" THEN LPRINT:LPRINT 31050 RETURN 31060 'THESE ARE THE TAB SETTINGS 40000 'COLUMN PRINT FORMATS 40100 RETURN 40 IF PD$<>"S" THEN LPRINT:LPRINT 31050 Ra b"This is the RE-KEY utility program for CREATOR data files."::@b"This program will allow you to do the following:"eb("1. Repair a damaged key file."b2"2. Create a new key file for a field not previously a key."c<"3. Create added keys for records you may have appended to an":" existing data file."McF:"You must be able to tell me a few things about your data file."dP"For example, the record length, the beginning position and":"length of the key field, and the maximum number of records":"allowed in the file. Of course, you must know the name of the"HdZ"data file, as well. DEPRESS ANY KEY TO CONTINUE: ";addAN$: AN$"" d5en"You may not use a packed field as a key field. Record length":"can be up to 256, key length up to 255.":"When I ask for file names, please give the complete file name,":"including the . type and drive!"iex:"Now give me the complete DATA file name: ";e DF$: DF$"A" (DF$) "Illegal name!": xf"Now tell me the maximum number of records allowed in this":"file, per data disk: ";Lf MR$: (MR$) (MR$) "Illegal number of records!": f"What is the record length of each record in the data file:";: RL$f (RL$) (RL$) "Illegal record length!": g"What is the name of the proposed KEY file? ";: KF$Pg KF$"A" (KF$) "Illegal key file name!": g"What is the beginning position of the key field in the data":"record? THIS IS NOT USUALLY THE FIELD NUMBER! ";2h ST$: (ST$) (ST$)(RL$) "Illegal starting position: should be from 1 to";(RL$): h"What is the length of the key field: ";: KL$: (KL$) (KL$) (KL$)(RL$) "Illegal key length!": h"R",,DF$,(RL$)h"R",,KF$,i #,(ST$) AS D$,(KL$) AS K$#iRL%(RL$): RL% RL%6i #,RL% AS B$FiMR%(MR$)i" R%(MR%): I% MR%:R%(I%): I%:I%:KL%(KL$)i, B$(RL%,): ,:"RE-KEYING THROUGH RECORD NUMBER ";i6I%I%: ,I%:F%KL%: B$(RL%,) i@ I%; jT K$() j^RPMS=jhRPRP: RPMR% RP RPTjr R%(RP) hij|R%(RP)I%: 6jZZ$(K$,F%): jRPRP: RPMR% RP RPj R%(RP) R%(RP)I%: 6:: j ::"WRITING KEY POINTERS NOW."k #, AS KP$r4AA: r>XF$"GOSUB 30000"rHAA: #,"30805 FOR IX=1 TO ";ArR I A: #,0uI;"FF(";I;")=";F%(I):Vs #,"50 DIM F$(";A;"),FF(";A;"),P(";A;"),P$(";A;"),C#(50),P#(";A;"),C(50),C$(50),H$(50)"{s #,"60 ";XF$:XF$"GOSUB 30800"s CLS$;"What are your column headings to be? Please enter a legend":"for each column you intend to use. Type 999 to end."t C%(2): J 2:C%(J)J:)t C$(2)1tBt"Column number";B;: C$(B): C$(B)"999" C$(B)"":BB:: BB: tJ: JJ B: (C$(C%(JJ)))(C$(C%(JJ))) JC%(JJ):C%(JJ)C%(JJ):C%(JJ)J:Jt: J :: LNFEu I B:I$((I),): #,LN;"H$(";I$;")=";Q$;C$(I);Q$:LNLN :muM$(2, ):"REPORTOR.OVL",,ALLyu T(2)u CLS$;"Now we need to set the tabs for your";B;"columns. Indicate":"the tab setting as a number, from 1 to 255."rv I B:"Tab setting for column number";I;":";: F1$:T(I)(F1$): T(I) T(I) "NOT A VALID TAB SETTING!":IIxv.vB #,"31070 DATA ";vL I B: #,((T(I)),);",";:vj #,((T(B)),) wtLNLN : #,LN;"PG=1:'INITIALIZE THE PAGE COUNTER"Fw~ #,LN;"'NOW FOLLOWS THE RECORD RETRIEVAL SECTION"uw"Do you want the pages numbered (Y/N)? ";wCV$: CV$"" :: <: CV$:PG$CV$: PG$"Y" PG$"N" "ILLEGAL!": wLNLN : #,LN;"FOR I=1 TO 32767"-x #,LN;"IF SR$<>";Q$;"N";Q$;" THEN INPUT #2,I"@xLNLN :KZLNx RL #,LN;"IF ZU$=STRING$(";RL;",0) THEN 20000":: #,LN;"IF ZU$=STRING$(255,0) THEN 20000"xLNLN : #,LN;"ON ERROR GOTO 20000"y PG$"Y" "How many lines per page? ";: F1$:LP(F1$)iy CLS$:J: I A: F%(I) F%(I) F%(I) F%(I) J:IAy: J I A:D$(I)"C":: [z"You have some fields which might be packed data. Please tell":"me if they are PH (packed half precision), packed integer (PI),":"packed single precision (PS) or packed double precision (PD)."z I A: F%(I) F%(I) F%(I) F%(I) D$(I)"C": d{"Field number";I;":Length is";F%(I);": Data type is: ";: CV$: <:D$(I)CV$:LF%(I)z{2 D$(I)"N" D$(I)"C" D$(I)"PH" D$(I)"PI" D$(I)"PS" D$(I)"PD" "ILLEGAL VARIABLE TYPE!": {< (CV$"PH" L) (CV$"PI" L) (CV$"PS" L) (CV$"PD" L) _{F CV$"N" CV$"C" _"|Z"ILLEGAL LENGTH FOR THIS VARIABLE TYPE!": B|_"Is this correct (Y/N)? ";j|`CV$: CV$"" `:: <: CV$|a CV$"N" :: CV$"Y" _|d| I A:I$((I),)|LNLN : D$(I)"C" D$(I)"N" #,LN;"P$(";I$;")=F$(";I$;")"8} D$(I)"PH" #,LN;"P#(";I$;")=ASC(F$(";I$;"))-128"p} D$(I)"PI" #,LN;"P#(";I$;")=CVI(F$(";I$;"))"} D$(I)"PS" #,LN;"P#(";I$;")=CVS(F$(";I$;"))"} D$(I)"PD" #,LN;"P#(";I$;")=CVD(F$(";I$;"))"}:"REPORTOR.OVL",,ALL~O :l~P ~  "PROGRAM ALREADY EXISTS. DEPRESS C TO WRITE OVER IT, ANY OTHER":"TO QUIT":: n ~Z Q$: Q$"" Z :: Q$"C" : ~d Q$"c" : :: :Dn 4 "YOU ENTERED BASIC WITHOUT SPECIFYING ANY FILES.":"YOU NEED AT LEAST TWO. GO BACK TO CP/M AND ENTER BASIC CORRECTLY."::ap 5  : s "ERROR NUMBER";;"AT LINE";;":PROGRAM ABORTED.": x ::REPLACE A STRING WITH ANOTHER F1% SX$F1$(SX$,(C$(J))):,SX$(SX$,F1%)F1$(SX$,F1%(C$(J))):REPLACE A Sa:REPORTOR; WRITTEN ON 1/16/80 BY BRUCE W. TONKIN/b:ADAPTED FOR CP/M AND MICROSOFT BASIC 5.01 ON 5/11/80b:FOR 4.51 ON 3/18/81, AND FOR MODEL III ON 2/20/83, FOR CP/M AND MBASIC 4.51/5.2+ AGAIN ON 3/23/83; FOR 48K CP/M WITH OVERLAYS ON 7/2/83; THIS IS THE OVERLAYec#:THIS IS PUBLIC DOMAIN SOFTWARE AND MAY NOT BE SOLD OR INCORPORATED IN ANY COMMERCIAL SOFTWARE WITHOUT THE EXPRESS PERMISSION OF THE AUTHORoc2 "c<FX: (CV$) cF II (CV$):CV%((CV$,II,)): CV%" FX(FX)dP FX CV%Z CV%CV% _:(CV$,II,)(CV%) dZ:d" CLS$;"Now we must describe what goes into the columns of the report.":"You should write sentences of the following form:"d,"Column name=FIELD(9)"d6"Column name=FIELD$(5)" e@"IF Column.name.1=Column.name.2 THEN Column.name.3=";Q$;"SAME";Q$3eJ"V1=Name1/Name2:V2=100*V1:Name3=V2"aeT"IFr":"variables. Variables beginning with the letter V are work":"variables. You may issue a number of commands on one line, if":"you separate them with a colon (:)"fr"Also, note the quotation marks around string constants,":"and the $ sign used for string fields.":"DEPRESS ANY KEY FOR MORE INFORMATION: ";g|CV$: CV$"" |Bg:"YOU MAY USE THE FOLLOWING VARIABLE NAMES:"rg I B: C$(I),:::"TYPE 999 TO EXIT."g"READY FOR YOUR COMMAND: ";g SX$: (SX$) g I B:JC%(I)gF1%(SX$,C$(J)): F1% 8hJ$((J),):I$((I),): (M$,J,)"S" F1$"C$(":: F1$"C#("WhF1$F1$J$")": : ]hhF1%(SX$,"FIELD"): F1% :h F1% "FIELDS CANNOT BE RE-DEFINED.": /iF2%(F1%,SX$,"("):F3%(F1%,SX$,"$"):F4%(F1%,SX$,"#"): (F4% F4%F2%) (F3% F3%F2%) SY$"#":: SY$""aiSX$(SX$,F1%)"P"SY$(SX$,F1%): i:"I interpret your command to be:": SX$:"Is this correct (Y/N)? ";iDCV$: CV$"" D:: <: CV$: ("YN",CV$) :jN CV$"N" "INSTRUCTION DELETED.": djXF1%(SX$,"SKIP"): F1% SX$(SX$,F1%)"19000"(SX$,F1%): XjbLNLN : #,LN;SX$: jLNLN : #,LN;"FOR J=1 TO ";B;":T#(J)=T#(J)+C#(J):NEXT"j  k CLS$;"All right. Now we need to define the column print formats.":"I will ask you to tell me if a column will contain letters or":"numbers. If a column contains numbers, but those numbers come"Vl "from an unpacked field, and are not used as numbers (for ":"example, phone numbers or ID numbers), then that column should":"be formatted as if it were LETTERS. On the other hand, a "m"column containing the result of a computation, or a column":"containing numbers coming from a PACKED numeric field should":"be formatted as NUMBERS. If you do not tell me the correct"Om "format, your report will contain zeros or blanks."fm* CF$(B): I Bm4"COLUMN NAME: ";C$(I);": NUMBERS OR LETTERS (N/L)? ";m>CV$: CV$"" >:: <: CV$: ("NL",CV$) 4mH CV$"L" XnR"How many characters might be printed in this column";: FX: FX FX "Invalid!": Rn\ FX CF$(I)"!":: CF$(I)"\"(FX, )"\"nf o"How many digits will be printed to the LEFT of the decimal";: FX: FX FX "Illegal!": oCF$(I)(FX,"#")co FX :: "Do you want the number printed with commas (Y/N)? ";:oCV$: CV$"" :: <: CV$: ("YN",CV$) o CV$"Y" CF$(I)CF$(I)","/p"How many digits will be printed to the RIGHT of the decimal";: FX: FX FX "Illegal!": Vp FX CF$(I)CF$(I)"."(FX,"#")p CF$(I)"" "ILLEGAL FORMAT!": p (CF$(I),"#") (M$,I,)"M":: (M$,I,)"S"pp "REPORTOR.BAS",,ALLq I B: #,@I;"CF$(";((I),);")=";Q$;CF$(I);Q$:kq #,"56 M$=";Q$;M$;Q$;":'FIELD TYPES - S = STRING, M =MULTIPLE PRECISION"q CLS$;"How many columns wide is the paper or screen the report will":"be printed on";: FX: FX FX "Illegal!":  r LNLN : #,LN;"IF L=0 AND PD$<>";Q$;"S";Q$;" THEN LPRINT CHR$(12);TAB(";(FX(T$));");TI$";: LP #," ":: #,";TAB(";FX;");";Q$;"PAGE NUMBER";Q$;";PG"Hs LNLN : #,LN;"IF L=0 AND PD$<>";Q$;"P";Q$;" THEN PRINT CHR$(12);TAB(";(FX(T$));");TI$";: LP #," ":: #,";TAB(";FX;");";Q$;"PAGE NUMBER";Q$;";PG"ws. LNLN : #,LN;"IF L=0 THEN GOSUB 31000"s8 #,"31006 FOR J=1 TO ";B:LNLN : #,LN;"FOR J=1 TO ";BsB LNLN : #,LN;"READ T:IF PD$=";Q$;"P";Q$;" THEN ";LNXtL LNLN : #,LN;"IF MID$(M$,J,1)=";Q$;"S";Q$;" THEN PRINT TAB(T);:PRINT USING CF$(J);C$(J);"tV LNLN : #,LN;"IF MID$(M$,J,1)=";Q$;"M";Q$;" THEN PRINT TAB(T);:PRINT USING CF$(J);C#(J);"t` LNLN : #,LN;"IF PD$=";Q$;"S";Q$;" THEN ";LNVub LNLN : #,LN;"IF MID$(M$,J,1)=";Q$;"S";Q$;" THEN LPRINT TAB(T);:LPRINT USING CF$(J);C$(J);"ud LNLN : #,LN;"IF MID$(M$,J,1)=";Q$;"M";Q$;" THEN LPRINT TAB(T);:LPRINT USING CF$(J);C#(J);" vf LNLN : #,LN;"NEXT:RESTORE:IF PD$<>";Q$;"S";Q$;" THEN LPRINT:ELSE PRINT"nvh LNLN : #,LN;"L=L+1";: LP #,":IF L>";LP;" THEN PG=PG+1:L=0":: #,":'LINE COUNTER"vj LN8J: #,LN;"NEXT"6wl RL #,KZ;"GET 1,I:IF ZU$=STRING$(";RL;",255) OR ZU$=STRING$(";RL;",250) THEN ";LN:: #,KZ;"GET 1,I:IF ZU$=STRING$(255,250) OR ZU$=STRING$(255,255) THEN ";LNwn RL #,"30801 FIELD #1,";RL;"AS ZU$":: #,"30801 FIELD #1,255 AS ZU$"wp CLS$;"Have you saved any totals you want printed at the end of your":"report (Y/N)? ";6xr CV$: CV$"" r :: <: CV$: ("YN",CV$) "ILLEGAL!": r cxt CV$"N" #,"20000 CLOSE:END": F y~ CLS$;"Then you must tell me which variables to print in which columns":"of your report. Please be careful here: you CANNOT print":"strings in numeric columns, or vice-versa!"y "You may use the BASIC operations +, *, /, and - (and others)":"if you wish. As a default, just hit the enter key: I will":"print the grand total for a column, using the same print"z "format as the previous data in that column.":LN Nuz #,LN;"IF PD$<>";Q$;"S";Q$;" THEN LPRINT":LNLN : #,LN;"IF PD$<>";Q$;"P";Q$;" THEN PRINT"6{ "If you want to use the totals in your computations, the totals":"are stored in the variable array T#(X), where X is the column":"number. Feel free to use these totals in computations."D{ I Bp{ "COLUMN NAME: ";C$(I);": DEFAULT IS ";{ (M$,I,)"S" "BLANK":: "T#(";I;")":"COLUMN PRINT FORMAT IS:";CF$(I){ "What should I print in this column: ";: CV$| CV$((CV$), ) CV$""E| CV$"" (M$,I,)"S" CV$Q$Q$| CV$"" (M$,I,)"M" CV$"T#("((I),)")"| LNLN : #,LN;"READ T:IF PD$<>";Q$;"S";Q$;" THEN LPRINT TAB(T);:LPRINT USING CF$(";((I),);");";CV$;";"^} LNLN : #,LN;"IF PD$<>";Q$;"P";Q$;" THEN PRINT TAB(T);:PRINT USING CF$(";((I),);");";CV$;";"} :LNLN : #,LN;"IF PD$<>";Q$;"S";Q$;" THEN LPRINT CHR$(12)":LNLN : #,LN;"IF PD$<>";Q$;"P";Q$;" THEN PRINT:PRINT";Q$;"END OF REPORT";Q$~ LNLN : #,LN;"CLOSE:END")~F "I",,"R451.LIB"7~G K S~H #,A$: #,A$: G f~K #,"3 RESET"#L CLS$;"Your report program has been written. You may run it any time.":"If you wish, you may load your program, then re-save it: this":"will decrease subsequent program load times."+O :@P :ERROR HANDLERs "ERROR NUMBER";;"AT LINE";;":PROGRAM ABORTED.": x ::REPLACE A STRING WITH ANOTHER F1% SX$F1$(SX$,(C$(J))): SX$(SX$,F1%)F1$(SX$,F1%(C$(J))):REPLACE A STRING WITH ANOTHER F1%