DEF 2068

Developer(s): Kenneth Majors
Date: 1985
Type: Program
Platform(s): TS 2068

Demo for a product inventory database.

Related Content

Gallery

DEF 2068

Source Code

    2 DIM e$(10,100)
    5 LET p=VAL "1"
   10 GO TO VAL "9000"
 1001 CLS : LET a$="": LET k$="": LET b$="000000000": LET c$="                    "
 1005 PRINT AT 0,5; INVERSE 1;"Add records"
 1009 LET x=VAL "2": LET y=VAL "11": FOR b=VAL "1" TO VAL "8": READ l,l$
 1010 PRINT AT x,VAL "0";l$;: FOR k=VAL "1" TO l: PRINT AT x,y+k;CHR$ VAL "45";: NEXT k: LET k=VAL "1": GO SUB VAL "1500": NEXT b
 1015 DATA VAL "9","Stock# ",VAL "20","Discript ",VAL "11","Supplier ",VAL "4","Qty ",VAL "6","Unit Price ",VAL "6","Retail Price ",VAL "3","Low Limit ",VAL "3","Back Order "
 1050 INPUT INVERSE 1;"Hit ENTER to log this record or C to reenter it",,x$
 1055 IF x$="C" OR x$="c" THEN RESTORE : GO TO VAL "1001"
 1060 LET a$=a$+"/": LET e$(p, TO 100)=a$: LET p=p+1
 1065 IF p>=10 THEN PRINT ; FLASH 1;"File Full": PAUSE 500: RETURN 
 1070 INPUT INVERSE 1;"More?     Y/N",x$
 1075 IF x$="N" OR x$="n" THEN RESTORE : RETURN 
 1080 RESTORE : GO TO VAL "1001"
 1500 PAUSE VAL "0": LET q$=INKEY$
 1505 IF q$=CHR$ VAL "13" AND k<>VAL "0" THEN GO TO VAL "1527"
 1510 IF q$=CHR$ VAL "12" AND k>VAL "0" THEN LET k=k-1: PRINT AT x,y+k;CHR$ VAL "45": LET k$=k$( TO k-1): GO TO VAL "1500"
 1515 IF q$<CHR$ VAL "32" THEN GO TO VAL "1500"
 1520 LET k$=k$+q$: PRINT AT x,y+k;q$: LET k=k+VAL "1"
 1525 IF k<=l THEN GO TO VAL "1500"
 1527 IF x=VAL "2" THEN LET k$=b$( TO l-LEN k$)+k$: LET a$=a$+k$
 1528 IF x>=VAL "4" THEN LET k$=k$+c$( TO l-LEN k$)
 1530 IF x>VAL "2" AND x<=VAL "16" THEN LET a$=a$+"*"+k$
 1532 IF x=VAL "8" THEN LET f$=k$
 1533 IF x=VAL "10" OR x=VAL "12" THEN LET k$=STR$ (VAL f$*VAL k$): LET k$=c$( TO VAL "9"-LEN k$)+k$: LET a$=a$+"*"+k$
 1535 LET x=x+VAL "2": LET k$="": RETURN 
 3001 CLS : PRINT INVERSE 1;"Search for a Record",: LET l$="": LET q$=""
 3005 INPUT INVERSE 1;"Enter a Stock Number",x$
 3010 IF x$="" THEN GO TO VAL "3005"
 3015 LET x$=b$( TO VAL "9"-LEN x$)+x$
 3025 FOR x=VAL "1" TO p
 3027 IF e$(x,1 TO 9)=x$ THEN GO TO 3060
 3035 NEXT x
 3040 PRINT "File not found": PAUSE 50: RETURN 
 3060 LET y=VAL "2": PRINT AT VAL "2",VAL "0";"Stock #"''"Discript"''"Supplier"''"Qty"''"Unit Price"''"Rtl Price"''"Low limit"''"Bck Order"
 3063 LET d=VAL "0": LET b=VAL "10"
 3065 FOR z=VAL "1" TO VAL "100"
 3070 IF e$(x,z)<>"*" THEN PRINT AT y,b+(z-x)-d;e$(x,z);
 3075 IF e$(x,z+1)="*" OR e$(x,z+1)="/" THEN GO TO 3100+(20*(e$(x,z+1)="/"))
 3080 NEXT z
 3085 GO TO VAL "3120"
 3100 IF y=10 AND b=10 OR y=12 AND b=10 THEN PRINT TAB VAL "18";"Ext ";: LET b=VAL "21": LET d=z-x: NEXT z
 3103 PRINT : LET y=y+VAL "2": LET d=z-x: LET b=VAL "10"
 3105 NEXT z
 3120 FOR z=VAL "1" TO VAL "4": LET q$=q$+SCREEN$ (8,9+z): NEXT z
 3140 FOR z=VAL "1" TO VAL "3": LET l$=l$+SCREEN$ (14,9+z): NEXT z
 3143 IF q$="    " THEN GO TO VAL "3150"
 3145 IF VAL l$>=VAL q$ THEN PRINT FLASH VAL "1";AT VAL "14",VAL "10";l$
 3175 INPUT INVERSE 1;"Press enter for new search","Q to quit",,"C to copy",,k$
 3180 IF k$="Q" OR k$="q" THEN RETURN 
 3185 IF k$="" THEN GO TO 3000
 3188 IF k$="c" OR k$="C" THEN COPY 
 3190 GO TO 3175
 5001 PAPER 2: INK 7: CLS : PRINT TAB 12; FLASH VAL "1";"WARNING": PRINT TAB VAL "4";"This will erase data!!"; PAPER 7; INK 0: PAUSE 100: GO SUB VAL "3000": INPUT INVERSE 1;"Delete this?  Y/N",x$
 5010 IF x$="N" OR x$="n" THEN RETURN 
 5020 LET e$(x)=c$: FOR l=x TO p: LET e$(l)=e$(l+1): NEXT l: LET p=p-1
 5023 INPUT INVERSE 1;"More? Y/N ";x$: IF x$<>"Y" OR x$<>"y" THEN PAPER VAL "7": INK VAL "0": RETURN 
 5025 GO TO VAL "5001"
 8000 CLS : INPUT INVERSE 1;"L = load file S = save file",k$
 8010 IF k$="L" OR k$="l" THEN INPUT INVERSE 1;"enter file name ";k$: LOAD k$
 8050 IF k$="S" OR k$="s" THEN INPUT INVERSE 1;"enter file name ";k$: SAVE k$ LINE 9040
 8055 RETURN 
 9040 CLS : PRINT INVERSE 1;"            Main Menu",
 9045 PRINT AT 7,VAL "5";"A = Add Records"''TAB VAL "5";"D = Delete a Record"''TAB VAL "5";"S = Search for a Record"''TAB VAL "5";"Q = Quit"
 9047 INPUT INVERSE 1;"Select Option and press ENTER",o$
 9050 IF o$="A" OR o$="a" THEN GO SUB VAL "1000"
 9060 IF o$="D" OR o$="d" THEN GO SUB VAL "5000"
 9070 IF o$="S" OR o$="s" THEN GO SUB VAL "3000"
 9080 IF o$="Q" OR o$="q" THEN GO SUB VAL "8000"
 9090 GO TO VAL "9040"
Scroll to Top