Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Correcting the code
#11
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 + ...
Reply


Messages In This Thread
Correcting the code - by Chris - 10-27-2023, 07:19 PM
RE: Correcting the code - by bplus - 10-27-2023, 08:28 PM
RE: Correcting the code - by SMcNeill - 10-27-2023, 09:31 PM
RE: Correcting the code - by Chris - 10-28-2023, 06:34 AM
RE: Correcting the code - by SMcNeill - 10-28-2023, 01:46 PM
RE: Correcting the code - by Stuart - 10-28-2023, 10:43 AM
RE: Correcting the code - by Chris - 10-28-2023, 11:34 AM
RE: Correcting the code - by Chris - 10-28-2023, 11:49 AM
RE: Correcting the code - by bplus - 10-28-2023, 12:55 PM
RE: Correcting the code - by Chris - 10-28-2023, 02:13 PM
RE: Correcting the code - by bplus - 10-28-2023, 02:46 PM
RE: Correcting the code - by SMcNeill - 10-28-2023, 06:18 PM
RE: Correcting the code - by Chris - 10-28-2023, 07:44 PM
RE: Correcting the code - by bplus - 10-28-2023, 07:47 PM
RE: Correcting the code - by SMcNeill - 10-28-2023, 09:48 PM
RE: Correcting the code - by bplus - 10-28-2023, 07:51 PM



Users browsing this thread: 7 Guest(s)