Compucolor.org – Virtual Media

Listing of file='MENU.BAS;01' on disk='vmedia/inventory-sector.ccvf'

1 REM  INVENTORY PROGRAM
2 REM  COPYWRITED JUNE 10, 1980 BY COMPUWORLD
3 REM  MASTER CONTROL PROGRAM
5 PLOT 15:POKE 33289,132
10 GOTO 63000
20 REM
50 DIM A$(20),A1$(20)
55 DIM BA$(7)
60 DATA "110","150","300","1200","2400","4800","9600"
65 FOR I= 1TO 7:READ BA$(I):NEXT I
100 GOSUB 1000:GOSUB 1300
220 GOSUB 1400
300 GOSUB 1600
305 GOSUB 1700
400 IF LEN (A$(O))= 0THEN 500
450 LOAD A$(O):RUN
500 IF O= 2THEN 510
505 GOSUB 1800:GOTO 300
510 GOSUB 2000:GOTO 300
999 END
1000 REM  CRT DEFAULTS
1005 KB= 33278:KF= 33247
1010 CL$= CHR$ (26):REM  CURSOR LEFT
1015 EL$= CHR$ (11):REM  ERASE LINE
1020 ES$= CHR$ (12):REM  ERASE PAGE
1025 EB$= CHR$ (31):REM  BLINK
1030 DB$= CHR$ (15):REM  DISABLE BLINK
1035 EE$= "":FOR I= 1TO 31:EE$= EE$+ EL$+ CHR$ (10):NEXT I
1040 I1= 40:DH$= "":SP$= "":DX$= "":FOR I= 1TO I1
1045 DH$= DH$+ "_":SP$= SP$+ " ":DX$= DX$+ CL$:NEXT I
1050 RETURN
1052 REM  SECOND ENTRY POINT   CH=CHARACTER
1055 POKE KF,31:POKE KB,0
1060 CH= PEEK (KB):IF CH= 0THEN 1060
1063 IF CH= 26OR CH= 13THEN RETURN
1070 IF CH< 32THEN 1055
1075 IF CH< 97THEN RETURN
1078 IF LC= 0THEN 1055
1080 CH= CH- 32:GOTO 1065
1095 RETURN
1100 REM  CURSOR CONTROL
1105 PLOT 3,X,Y:RETURN
1200 REM  GET DATA LINE  RETURN D$,D  DD=LENGTH OF INPUT LINE
1205 D$= "":PRINT LEFT$ (DH$,DL);LEFT$ (DX$,DL);
1210 GOSUB 1052:D1$= CHR$ (CH):DD= LEN (D$)
1215 IF CH< > 13THEN 1230
1217 IF DT= 2OR DT= 5THEN D= VAL (D$):GOTO 1225
1220 D= 0:IF DT= 1OR DT= 6THEN RETURN
1222 IF DT> 1AND DT< 6THEN D= VAL (D$):RETURN
1223 RETURN
1225 IF D> 32500OR D< - 32500THEN DD= 0:RETURN
1226 GOTO 1222
1230 IF CH< > 26THEN 1265
1235 IF DD= 0THEN GOTO 1210
1240 PRINT CL$+ "_"+ CL$;
1245 IF DD= 1THEN D$= ""
1246 IF DD< > 1THEN D$= LEFT$ (D$,DD- 1)
1247 GOTO 1210
1265 IF DT< > 1THEN 1280
1270 D$= D$+ D1$:PRINT D1$;:DD= LEN (D$):IF DD= DLTHEN 1217
1275 GOTO 1210
1280 IF DT< > 2THEN 1285
1282 IF D1$< "0"THEN 1295
1283 IF D1$> "9"THEN 1295
1284 GOTO 1270
1285 IF DT< > 3THEN 1288
1286 IF D1$= "."THEN 1270
1287 GOTO 1282
1288 IF DT< > 4THEN 1291
1289 IF D1$= "-"THEN 1270
1290 GOTO 1286
1291 IF DT< > 5THEN 1294
1292 IF D1$= "-"THEN 1270
1293 GOTO 1282
1294 IF DT= 6THEN 1282
1295 GOTO 1210
1300 REM  TITLES
1305 PRINT ES$
1310 X= 15:Y= 0:GOSUB 1100:PLOT 19,14
1315 PRINT "INVENTORY MASTER CONTROL PROGRAM"
1320 PLOT 15:RETURN
1400 REM  PROGRAM TITLE LOAD
1405 MX= 0
1410 I$= "INV":I1$= "INVENTORY PROGRAM":GOSUB 1500
1425 I$= "":I1$= "ALLOCATE SYSTEM DATA FILES":GOSUB 1500
1430 I$= "":I1$= "SYSTEM CONFIGURATION PROGRAM":GOSUB 1500
1495 RETURN
1500 REM  LOAD TITLES
1505 MX= MX+ 1:A$(MX)= I$:A1$(MX)= I1$:RETURN
1600 REM  DISPLAY PROGRAMS
1605 X= 0:Y= 2:GOSUB 1100:PRINT LEFT$ (EE$,50):PLOT 23:Y= 7:GOSUB 1100
1610 FOR I= 1TO MX
1615 N= 48+ I:IF I> 9THEN N= 55+ I
1620 PLOT 23:PRINT CHR$ (N);:PLOT 21:PRINT " - ";:PLOT 22:PRINT A1$(I)
1625 NEXT I
1630 X= 0:Y= MX+ 8:GOSUB 1100
1635 PLOT 18:PRINT "ENTER OPTION DESIRED * _"+ CL$;
1640 GOSUB 1052:PLOT CH:O$= CHR$ (CH):PRINT LEFT$ (EE$,4):IF CH= 13THEN 1630
1645 O= VAL (O$):IF CH> 64THEN O= O- 55
1650 IF O> 0AND O< = MXTHEN RETURN
1655 Y= Y+ 1:PLOT 17:GOSUB 1100
1660 PRINT EB$+ "INVALID OPTION!"+ DB$:GOTO 1630
1700 REM  SQUARE
1705 IF LEN (A$(O))= 0THEN RETURN
1710 PRINT ES$
1715 X= 18:Y= 8:PLOT 14
1720 Y= Y+ 2:GOSUB 1100:PRINT "*****************************"
1725 Y= Y+ 2:GOSUB 1100:PRINT "*                           *"
1730 Y= Y+ 2:GOSUB 1100:PRINT "*   P L E A S E   W A I T   *"
1735 Y= Y+ 2:GOSUB 1100:PRINT "*                           *"
1740 Y= Y+ 2:GOSUB 1100:PRINT "*****************************"
1745 REM 
1750 PLOT 15:RETURN
1800 REM  CONFIG ROUTINE
1805 X= 0:Y= 2:GOSUB 1100:PRINT LEFT$ (EE$,50)
1810 Y= 4:GOSUB 1100
1815 FILE "T",1820:GOTO 1840
1820 FILE "N","CONFIG.DAT;1",1,12,1
1825 FILE "R",1,"CONFIG.DAT",1
1830 PUT 1,1;0,0,4:FILE "C",1
1840 FILE "R",1,"CONFIG.DAT;1",1
1845 GET 1,1;C1,C2,C3
1850 PLOT 22:PRINT "DEFAULT SYSTEM PARAMETERS":PRINT
1855 PLOT 19:I$= "CD0: (INTERNAL DRIVE)"
1860 IF C1= 1THEN I$= "CD1: (EXTERNAL DRIVE)"
1862 PRINT "1 - DATA DISK DRIVE = ";I$
1865 I$= "UPPER CASE ONLY":IF C2= 1THEN I$= "LOWER CASE & UPPER CASE"
1870 PRINT "2 - CHARACTER SET   = ";I$
1875 PRINT "3 - PRINTER BAUD RATE = ";BA$(C3)
1880 Y= 11:GOSUB 1100:PLOT 18
1885 PRINT "ENTER OPTION NUMBER TO CHANGE (X=EXIT) * _"+ CL$;
1890 GOSUB 1052:PLOT CH:I$= CHR$ (CH):PRINT LEFT$ (EE$,4):IF CH= 13THEN 1880
1895 IF I$= "X"THEN 1970
1900 K= VAL (I$):IF K> 0AND K< 4THEN 1910
1905 Y= Y+ 1:PLOT 17:GOSUB 1100:PRINT EB$+ "INVALID OPTION!"+ DB$:GOTO 1880
1910 ON KGOTO 1915,1930,1950
1915 Y= 6:GOSUB 1100:PLOT 23:PRINT EL$+ "1 - DATA DISK DRIVE = ";
1920 DT= 1:DL= 4:GOSUB 1200:IF DD= 0THEN 1927
1922 IF D$= "CD0:"THEN C1= 0:GOTO 1927
1923 IF D$= "CD1:"THEN C1= 1:GOTO 1927
1925 Y= 11:GOSUB 1100:PLOT 17:PRINT EL$+ EB$+ "INVALID PARAMETER!"+ DB$:GOTO 1910
1927 Y= 6:GOSUB 1100:GOTO 1855
1930 Y= 7:GOSUB 1100:PLOT 23:PRINT EL$+ "2 - CHARACTER SET   = ";
1935 DT= 1:DL= 1:GOSUB 1200:IF DD= 0THEN 1927
1940 IF D$= "L"THEN C2= 1:GOTO 1927
1945 IF D$= "U"THEN C2= 0:GOTO 1927
1947 GOTO 1925
1950 Y= 8:GOSUB 1100:PLOT 23:PRINT EL$+ "3 - PRINTER BAUD RATE = ";
1955 DT= 2:DL= 4:GOSUB 1200:IF DD= 0THEN 1927
1957 FOR I= 1TO 7:IF D$= BA$(I)THEN C3= I:GOTO 1927
1960 NEXT I:GOTO 1925
1970 Y= 11:PRINT :GOSUB 1100:PLOT 18:PRINT EL$+ "PROCEED TO UPDATE (Y OR N) * _"+ CL$;
1972 GOSUB 1052:I$= CHR$ (CH):PLOT CH:IF I$= "Y"THEN 1980
1975 GOSUB 1100:PLOT 19:PRINT EL$+ "UPDATE DISREGARDED"
1977 FOR I= 1TO 1000:NEXT I:GOTO 1990
1980 PUT 1,1;C1,C2,C3
1990 FILE "C",1
1995 RETURN
2000 REM  ALLOCATE FILES
2005 X= 0:Y= 2:GOSUB 1100:PRINT LEFT$ (EE$,50)
1882 Y= 5:PLOT 19:GOSUB 1100
2015 PRINT "HAVE YOU DONE A SYSTEM CONFIGURATION YET (Y OR N) * _"+ CL$;
2020 GOSUB 1052:PLOT CH:IF CH= 13THEN 2010
2025 I$= CHR$ (CH):IF I$= "Y"THEN 2040
2030 GOSUB 1800:GOTO 2000
2040 GOSUB 1100:PRINT EL$;"PROCEED TO CREATE DATA FILES (Y OR N) * _"+ CL$;
2045 GOSUB 1052:PLOT CH:I$= CHR$ (CH):IF CH= 13THEN 2040
2050 IF I$< > "Y"THEN RETURN
2052 PRINT
2055 GOSUB 1100:PLOT 22:PRINT EL$+ "PLEASE WAIT WHILE I ALLOCATE THE DATA FILES"
2057 FILE "T",2062:FILE "R",1,"CONFIG.DAT",1
2058 GET 1,1;C1,C2,C3:DS$= "":IF C1= 1THEN DS$= "CD1:"
2059 FILE "C",1:FILE "T",2080:GOTO 2065
2062 GOSUB 1100:PLOT 17:PRINT EB$+ "THERE IS NO SYSTEM CONFIGURATION DATA"+ DB$
2063 FOR I= 1TO 1000:NEXT I:GOTO 300
2065 IF LEN (DS$)< > 0THEN KK= 0:GOTO 2070
2066 Y= Y+ 2:GOSUB 1100:PLOT 18
2067 PRINT "REMOVE PROGRAM DISK AND INSERT DATA DISK, THEN PRESS (CR) ";
2068 GOSUB 1052:KK= 0
2070 FILE "R",1,DS$+ "PTNO",1:FILE "C",1
2071 GOSUB 1100:PLOT 17:PRINT EL$+ EB$+ "DATA FILES ALREADY EXIST!"+ DB$
2072 KK= 1
2075 FOR I= 1TO 1000:NEXT I:IF LEN (DS$)< > 0THEN RETURN
2076 GOTO 2085
2080 GOSUB 2100:KK= 1:IF LEN (DS$)= 0THEN 2085
2081 IF KK= 0THEN RETURN
2082 GOTO 300
2085 X= 0:Y= 9:GOSUB 1100:PLOT 18
2090 PRINT "REMOVE DATA DISK AND INSERT PROGRAM DISK, THEN PRESS (CR) ";
2095 GOSUB 1052:GOTO 2081
2100 REM  CREATE FILES
2110 A= 500
2115 B1$= "                                                  "
2120 B2$= "                       "
2125 FILE "N",DS$+ "PTNO",A,16,8
2130 FILE "N",DS$+ "MAS",A,73,7
2135 FILE "N",DS$+ "PTR",A,4,32
2140 FILE "R",1,DS$+ "PTNO",1
2145 FILE "R",2,DS$+ "MAS",1
2150 FILE "R",3,DS$+ "PTR",1
2155 FOR X= 1TO (A- 1):PUT 1,X;X+ 1:NEXT X
2160 PUT 1,A;0:PUT 1,1,5;0
2165 FOR Y= 1TO A:PUT 3,Y;0:NEXT Y
2170 FOR Z= 1TO A:PUT 2,Z;B1$[50],B2$[23]:NEXT Z
2175 FILE "C",1,2,3
2195 RETURN
50000 REM  CHECK DISK
50005 PLOT 27,4:PRINT "READ CD0: 180 F000-F07F":PLOT 27,27
50010 IF PEEK (61440)= 125THEN RETURN
50015 X= 0:Y= 4:GOSUB 1100
50020 PLOT 27,4:PRINT "WRITE CD0: 0 0-1000":PLOT 27,27
50025 POKE 32980,0:POKE 32981,0
50030 PLOT 17,14:PRINT "SOFTWARE COPYRIGHT VIOLATION!"
50035 PLOT 31:PRINT "PROGRAM ABORTED!":PLOT 15:END
63000 DATA 245,175,50,255,129,241,201
63005 TM= 256* PEEK (32941)+ PEEK (32940)- 7
63010 RESTORE 63000:FOR X= 1TO 7:READ D:POKE TM+ X,D:NEXT X
63015 BR= INT (TM/ 256):POKE 33221,195:POKE 33222,TM- BR* 256+ 1
63020 POKE 33223,BR:POKE 32941,BR:POKE 32940,TM- BR* 256
63025 CLEAR 1000:GOTO 20