Quote: SMcNeill
Your code doesn't work.
I repeat once again the rules that must be met.
1. If I enter the value zero (0) and confirm with the Enter key, the H# variable should have the value zero (H# = 0)
2. If I enter numbers in the range 1-999999 and confirm with the Enter key, such values should be included in the H# variable.
3. If I enter a 7-digit number, it should be entered automatically without using the Enter key.
4. If I press ONLY the Enter key, the variable should take the value of the variable N#. So H# = N#
My predecessors may not have understood exactly what I meant.
You are experts in this field, so there should be no problem with such a short code
Good thing I already have the whole thing fixed, reply #8!
https://qb64phoenix.com/forum/showthread...0#pid21010
Don't know why above link fails continuously???
@Chris I repeat post #8
Code: (Select All)
H$ = "": B$ = ""
While Len(H$) < 7
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
ElseIf B$ = "-" Then
If H$ = "" Then H$ = "-" Else Beep
ElseIf InStr("0123456789", B$) Then
H$ = H$ + B$
ElseIf B$ = Chr$(13) And H$ = "" Then
Beep
ElseIf B$ = Chr$(13) And H$ <> "" Then
Exit While
End If
_Limit 30
Wend
H! = Val(H$): Print "H ="; H!
b = b + ...