120 OPEN"R" #1 "INVEN.DAT",39
125 FIELD#1,1 AS F$,30 AS D$, 2 AS Q$,2 AS R$,4 AS PH
130 PRINT:PRINT "FUNCTIONS:":PRINT
135 PRINT 1,"INITIALIZE FILE"
140 PRINT 2 "CREATE A NEW ENTRY"
150 PRINT 3,"DISPLAY INVENTORY FOR ONE PART"
160 PRINT 4 "ADD TO STOCK"
170 PRINT 5,"SUBTRACT FROM STOCK"
180 PRINT 6,"DISPLAY ALL ITEMS BELOW REORDER LEVEL"
220 PRINT:PRINT:INPUT"FUNCTION";FUNCTION
225 IF (FUNCTION<1)OR(FUNCTION>6) THEN PRINT "BAD FUNCTION NUMBER":GOTO 130
230 ON FUNCTION GOSUB 900,250,390,480,560,680
240 GOTO 220
560 REM REMOVE FROM STOCK
570 GOSUB 840
580 IF ASC(F$)=255 THEN PRINT "NULL ENTRY":RETURN
590 PRINT DH
600 INPUT "QUANTITY TO SUBTRACT";S%
610 Q%=CVI(Q$)
620 IF (Q%-S%)<0 THEN PRINT "ONIY";Q%; "IN STOCK":GOTO 600
630 Q%=Q%-S%
640 IF Q%=<CVT(R$) THEN PRINT "QUANTITY NOW";Q%;
44 REORDER LEVEL";CVI(RH)
LSET Q$=MKU(Q%)
PUT#1,PART%
RETURN
DISPLAY ITEMS BELOW REORDER LEVEL
FOR 1=1 TO 100
GET#1J
IF OVI(tzH)OVI(RH) THEN PRINT Dtz;" QUANTITY";
OVI(Qtz) TAB(50) "REORDER LEVEL";CVI(R$)
NEXT I
RETURN
INPUT "PART NUMBER";PART%
IF(PART%<1)OR(PART%>100) THEN PRINT "BAD PART NUMBER": GOTO 840 ELSE GET#1 J>ART%:RETURN
END
REM INITIALIZE FILE
INPUT "ARE YOU SURE";B$:IF B$<="Y" THEN RETURN
LSET F$=CHR$(255)
FOR O=1 TO 100
PUT#1J
NEXT I
RETURN
