'****************************
' Child Menu 菜单选定界面
'****************************
Function fChildMenu$(m1$,m2$,m3$,m4$)
k$=""
sel%=0
Cls
While 1
Screen 1,0
If m1$<>"" Then
Locate 6,1,0 :Print "1. ";m1$
End If
If m2$<>"" Then
Locate 6,3,0 :Print "2. ";m2$
End If
If m3$<>"" Then
Locate 6,5,0 :Print "3. ";m3$
End If
If m4$<>"" Then
Locate 6,7,0 :Print "4. ";m4$;
End If
Locate 3,9,0:Print "";
Screen 1,1
Select k$
Case Chr$(13)
Beep ,,,0
fChildMenu$=Mid$(Str$(sel%),2)
Exit Function
Case Chr$(27)
If m1$<>"" Then
Beep ,,,0
fChildMenu$=Chr$(27)
Exit Function
End If
Case Chr$(49)
If m1$<>"" Then
Beep ,,,0
Locate 6,1,0 :Print "1. ";m1$
sel%=1
End If
Case Chr$(50)
If m2$<>"" Then
Beep ,,,0
Locate 6,3,0 :Print "2. ";m2$
sel%=2
End If
Case Chr$(51)
If m3$<>"" Then
Beep ,,,0
Locate 6,5,0 :Print "3. ";m3$
sel%=3
End If
Case Chr$(52)
If m4$<>"" Then
Beep ,,,0
Locate 6,7,0 :Print "4. ";m4$;
sel%=4
End If
End Select
k$=Input$(1)
Wend
End Function
'*****************************
' main
'*****************************
BEEP
KEY 5,CHR$(28)
Key 6,Chr$(29)
Key 7,Chr$(30)
Key 8,Chr$(31)
KEY 30,CHR$(27) 'M1 :ESC键退出键
MAIN:
Cls
Screen 1,0
locate 3,5:print "主程序界面"
While 1
k$=Input$(1)
If k$=chr$(27) Then
GoTo ERRCOMM
Else
s$=fChildMenu$("aaaaa","bbbbb","ccccc","")
Cls
If s$=chr$(27) Then
Print " 退出 "
End If
Screen 1,0
print s$
End If
Wend
ERRCOMM:
Cls
Beep 8
'Print "操作错误:"
'Print
'Print "按任意键退出";
'Wait 0,1
'k$=Input$(1)
End
阅读(1345) | 评论(0) | 转发(0) |