Common scan%
On Error GoTo ERRCOMM 'HANDLE ERROR
'****************************
' save to
'****************************
sub save(s1$)
Open "A:sv_tst.DAT" As #2
Field #2, 16 As s1$
put #2
close #2
end sub
'*********************************
' scan
'*********************************
Sub scan
id%=0
While 1
Open "BAR:" as #16 CODE "A","M","N","I","K","L","H"
Wait 0, 3 'Wait SCAN PORT
If Loc(#16) Then
Beep
id%=id%+1
id$=str$(id%)
s$=Input$(16,16)
Screen 1,0
Locate 1,3 :Print s$;
'**************save**************
Open "A:sv_tst.DAT" As #2
Field #2, 8 as id$,16 as s$
put #2
close #2
'********************************
Close #16
Else
Close #16
End If
Wend
End Sub
'***********************************
' Menu
'***********************************
Sub Menu
k$=""
sel%=0
scan%=0
Cls
while 1
Screen 1,1 :Locate 1,1,0 :Print " ∞ 主 菜 单 ∞ "
Screen 1,0
Locate 4,3,0 :Print "1:扫描"
Locate 13,3,0 :Print "2:出库"
Screen 1,1
Select k$
Case Chr$(13)
Beep
Select sel%
case 1
scan%=1
Exit sub
case 2
scan%=2
Exit sub
End Select
Case Chr$(49)
Beep
Locate 4,3,0 :Print "1:扫描"
sel%=1
Case Chr$(50)
Beep
Locate 13,3,0 :Print "2:出库"
sel%=2
End Select
k$=Input$(1)
Wend
End Sub
'*****************************
' main
'*****************************
MAIN:
Cls
Out &H6080,1 '0:standard-size; 1:the small-size
Call Menu
select scan%
case 1
Cls
Screen 1,0
Locate 1,1,0 :Print "扫描……"
Call scan
case 2
Cls
While 1
Screen 1,0
Locate 1,1,0 :Print "出库"
Wend
End select
ERRCOMM:
Cls
Beep 8
'Print "操作错误:"
'Print
'Print "按任意键重新载入";
'Wait 0,1
'k$=Input$(1)
End
阅读(1331) | 评论(0) | 转发(0) |