Any help would be greatly appreciated!! Here's what is happening:
When I choose #1 Recieving at the main menu that takes me to the "scan code" screen. Ok, so I want to quit and go back to the main menu so I press the F1 key (CRT$). When I go from this screen back to the main menu a couple of time the screen goes blank and the program stops. Should I put the "go back to main menu" command somewhere else note: I have commented out choices 2 thru 4 until I solve this.
Please help-I'm stuck!
'+===========================================================================+
'| Declaration variables |
'+===========================================================================+
private tempkey$
private ver$
'DIM FMAX%
DIM TBL$
DIM F1$
DIM F2$
DIM F3$
DIM F4$
DIM UP$
DIM DN$
DIM CL$
DIM CRT$
'
DIM NO$
DIM YES$
DIM CAN$
DIM CR$
DIM BS$
'+===========================================================================+
'| Initial Settings |
'+===========================================================================+
ver$ = "1.02"
out &h6080,1 ' Set to small-size font
'
OUT 6,0
'+===========================================================================+
'| Main menu |
'+===========================================================================+
FMAX%= 99
TBL$ = "-YZ+UVWQRS"
'
'
F1$ = "A"
F2$ = "B"
F3$ = "C"
F4$ = "D"
UP$ = "E"
DN$ = "F"
CL$ = "G"
CRT$ = "H"
'
NO$ = "D"
YES$= "C"
CAN$= CHR$(24)
CR$ = CHR$(13)
BS$ = CHR$(8)
'
OUT 6,0
main:
while 1
beep 3,1,1,1
'Display
cls
'screen 1,1
'print " Stellar ";ver$
screen 1,0
menu1 '
print ""
print "1.Receiving"
' print "2.Cycle Count"
' print "3.Phy. Inventory"
' print "4.Send"
'print "5.Review Data"
ON ERROR GOTO ERRRCV
'Go to each process
'GOSUB KBCLR
wait 0,&h01
tempkey$ = inkey$
beep 1,3,1,1
select tempkey$
case "1":
gosub menu
ON ERROR GOTO MENU
' case "2":
' gosub menu
' case "3":
' gosub menu
'case "4":
'gosub menu
'case "5":
'gosub BARIN3
' power 0
'ON ERROR GOTO ERRRCV
end select
wend
menu '
'
' ******************************************
' * Main *
' ******************************************
ON ERROR GOTO ERRRCV
SCREEN 0,0
BEEP 2
SCODE$ = " "
SURYO$ = " "
MAIN0 '
CLS
GOSUB FILOPN
KEN% = LOF(1)
IF LOF(1) >= FMAX% THEN
GOTO DSEND0
ENDIF
IF tempkey$ = "4" THEN
GOSUB DSEND0
ENDIF
MAIN1 '
MN%=0 : GOSUB DSP0
MAIN2 '
GOSUB BARIN
MAIN3 '
IF W$ = F1$ THEN
GOTO DSEND0
ENDIF
SCODE$ = BAR$
SURYO$ = "1"
MN%=1 : GOSUB DSP0
BAR$ = ""
GOSUB KOSUIN
GOSUB FWRT
IF W$ = UP$ THEN
GOSUB BARIN3
ENDIF
IF W$ = F1$ THEN
GOTO MAIN3
ENDIF
IF LOF(1) >= FMAX% THEN
GOTO MAIN0
ENDIF
MN%=2 : GOSUB DSP0
IF BAR$ <> "" THEN
GOTO MAIN3
ENDIF
GOTO MAIN2
' ******************************************
' * Input Bar Code *
' ******************************************
BARIN '
'KFLG% = 0
'SYS% = 0
'ON ERROR GOTO ERRRCV
'WAIT 0,&h03
W$=INKEY$
IF W$ = CRT$ THEN ‘ Press the CRT$ button(F4) to go back to main ‘ menu
CLOSE #1
CLOSE #2
END
GOSUB main:
ENDIF
KFLG% = 0
GOSUB BAROPN
GOSUB KBCLR
SYS% = 0
IF MN%<>0 THEN
LOCATE 1,1
PRINT CHR$(3);
ENDIF
BARIN0 '
IF EOF(2) = 0 THEN
GOTO BARIN1
ENDIF
BARIN2 '
WAIT 0,&h03
W$=INKEY$
'ON W$ = CRT$ GOSUB main:
IF W$ = CR$ AND KFLG% = 1 THEN
KEN% = LOF(1)
GOSUB FREAD
G% = 0
MN%=2 : GOSUB DSP0
GOTO BARIN
ENDIF
IF W$ = F1$ THEN
RETURN
ENDIF
IF W$ = "" THEN
IF KFLG% = 1 THEN
GOTO BARIN2
ELSE
GOTO BARIN0
ENDIF
ENDIF
BARIN3 '
IF W$ = UP$ AND KEN% >= 1 THEN
IF MN% <> 0 THEN
KEN% = KEN%-1
ENDIF
IF KEN% > 0 THEN
CLOSE #2
GOSUB FREAD
MN%=8 : GOSUB DSP0
KFLG% = 1
ELSE
KEN% = 1
ENDIF
ENDIF
IF W$ = DN$ AND KEN% < LOF(1) THEN
KEN% = KEN%+1
GOSUB FREAD
MN%=8 : GOSUB DSP0
ENDIF
IF KFLG% = 1 THEN
GOTO BARIN2
ENDIF
IF MN% = 0 THEN
IF W$ = MID$(TBL$,SYS%+1,1) THEN
SYS% = SYS%+1
ELSE
SYS% = 0
ENDIF
ENDIF
IF SYS% >= 10 THEN
CLOSE #2
GOSUB SYSUTY
MN% =0 : GOSUB DSP0
GOTO BARIN
ENDIF
GOTO BARIN0
BARIN1 '
INPUT #2,BAR$
BEEP 1
CLOSE #2
RETURN
'
' ******************************************
' * Input item quantity *
' ******************************************
KOSUIN '
GOSUB BAROPN
GOSUB KBCLR
X% = 0
SURYO$ = "1"
KOSU0 '
LOCATE X%+13,3
WAIT 0,&h03
W$ = INKEY$
IF EOF(2) = 0 THEN
SURYO$ = MID$("000",1,3-LEN(SURYO$))+SURYO$
GOTO BARIN1
ENDIF
IF W$ = F1$ THEN
SURYO$ = MID$("000",1,3-LEN(SURYO$))+SURYO$
RETURN
ENDIF
IF W$ = UP$ AND LOF(1)>=1 THEN
SURYO$ = MID$("000",1,3-LEN(SURYO$))+SURYO$
RETURN
ENDIF
IF W$ = "" THEN
GOTO KOSU0
ENDIF
IF W$ = BS$ THEN
IF X% > 0 THEN
X% = X%-1
SURYO$ = MID$(SURYO$,1,X%)
IF SURYO$="" THEN
SURYO$="1"
ENDIF
LOCATE 11,3
PRINT SURYO$;MID$(" ",1,3-LEN(SURYO$));
ENDIF
GOTO KOSU0
ENDIF
IF W$ = CAN$ THEN
SURYO$ = "1"
X% = 0
LOCATE 11,3
PRINT SURYO$;" ";
GOTO KOSU0
ENDIF
IF W$ = CR$ AND LEN(SURYO$) > 0 THEN
BEEP 3
SURYO$ = MID$("000",1,3-LEN(SURYO$))+SURYO$
LOCATE 1,3
PRINT " ";
RETURN
ENDIF
IF X% >= 3 THEN
GOTO KOSU0
ENDIF
IF ASC(W$) < ASC("0") THEN GOTO KOSU0 ENDIF
IF ASC(W$) > ASC("9") THEN GOTO KOSU0 ENDIF
'
BEEP 1
PRINT W$;