![]() |
Forum Index : Microcontroller and PC projects : MMBasic: unhelpful syntax issue with CASE IS
Author | Message | ||||
thwill![]() Guru ![]() Joined: 16/09/2019 Location: United KingdomPosts: 4302 |
Hi Peter & Geoff, Reproduced with CMM2, PicoMite (, MMB4L) and presumably also present in MMB4W: > list "case_is.bas" Option Explicit On Dim i = 2 Select Case i Case Is>=0 Print "Hello" Case Else Print "Goodbye" End Select > run "case_is.bas" Error in line 4: IS is not declared > Add a space after the IS keyword and it works. It's worse if you don't have OPTION EXPLICIT ON, because then this will unexpectedly print "Goodbye" !!! Best wishes, Tom Edited 2022-11-21 05:35 by thwill MMBasic for Linux, Game*Mite, CMM2 Welcome Tape, Creaky old text adventures |
||||
phil99![]() Guru ![]() Joined: 11/02/2018 Location: AustraliaPosts: 2611 |
Try:- ... Select Case i Case >=0 ... No IS in PicoMite manual > for i=-2 to 2:Select Case i :Case >=0:Print "Hello":Case Else:Print "Goodbye":End Select :next Goodbye Goodbye Hello Hello Hello > Edit Need new glasses, IS is there. This is interesting, without Option Explicit IS becomes a variable ANDed with i. > for i=-2 to 2:Select Case i :Case is>=0:Print "Hello":Case Else:Print "Goodbye":End Select :next Goodbye Goodbye Goodbye Hello Goodbye > ? is 0 > Edited 2022-11-21 08:18 by phil99 |
||||
TassyJim![]() Guru ![]() Joined: 07/08/2011 Location: AustraliaPosts: 6269 |
IS is optional in most (all?) MMBasic versions. Jim VK7JH MMedit |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10240 |
Known issue - no fix |
||||
thwill![]() Guru ![]() Joined: 16/09/2019 Location: United KingdomPosts: 4302 |
Thanks for the pointers folks, especially to the fact that the inclusion of the IS keyword is unnecessary. Best wishes, Tom MMBasic for Linux, Game*Mite, CMM2 Welcome Tape, Creaky old text adventures |
||||
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |