Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
IMP - Not this old chestnut again
#15
(10-16-2024, 02:57 PM)Dimster Wrote: While Gemini was thinking the above was an issue for IMP dealing with string values it told me QB64PE could have a bug in its application of IMP after the following code using IMP was tested :

Code: (Select All)
Input "Enter your age: ", age
isADULT = age >= 18

If isADULT Imp True Then
    Print "You are an Adult"
Else
    Print "You are a minor"
End If
 
The above code was Gemini's answer to a previous attempt on the use of IMP and touts that this code gives the correct answer.
And even that doesn't require IMP:

Code: (Select All)
Input "Enter your age: ", age
isADULT = age >= 18

If isADULT Then
    Print "You are an Adult"
Else
    Print "You are a minor"
End If
This also works and requires no "unusual" features. Unusual in that I've never needed an "implies" operator.
While 1
   Fix Bugs
   report all bugs fixed
   receive bug report
end while
Reply


Messages In This Thread
IMP - Not this old chestnut again - by Dimster - 10-16-2024, 02:57 PM
RE: IMP - Not this old chestnut again - by bplus - 10-16-2024, 04:01 PM
RE: IMP - Not this old chestnut again - by Pete - 10-16-2024, 10:25 PM
RE: IMP - Not this old chestnut again - by TDarcos - 10-23-2024, 02:59 AM



Users browsing this thread: 5 Guest(s)