Code: (Select All)
H$ = "": B$ = ""
While Len(H$) < 7
Cls
Locate 1, 1: Print Spc(8);
Locate 1, 1: Print H$
B$ = ""
While B$ = ""
B$ = InKey$
_Limit 30
Wend
If B$ = Chr$(27) Then End
If B$ = "-" Then
If H$ = "" Then H$ = "-" Else Beep
End If
If InStr("0123456789", B$) Then H$ = H$ + B$
If B$ = Chr$(13) Then Exit While
_Limit 30
Wend
Cls
H# = Val(H$): Print "H ="; H#
Also might not allow 0 as first digit but shouldn't matter when do Val.
I think this would be a whole lot easier with just Input "Enter your number ";h# then check it. Not sure if you want to allow floating decimal? h might be better as long integer as H!
b = b + ...