if-then-else parser issue
issueid=527 08-05-2017 09:12
Super Moderator
Number of reported issues by Petr Schreiber: 145
if-then-else parser issue
single line if then else triggers syntax error inside function, but not in global space

Hi Eros,

thanks to report from Kent I found some inconsisten behaviour. Check this example:

long a = 64
If a < 128 Then a = 255 Else a = 0 ' -- This will NOT cause runtime error (BUG) 
MsgBox 0, "Hi, I will never get displayed" ' -- This line gets eaten by ELSE statement

Function TBMain () As Long
  long b = 64
  If b < 128 Then b = 255 Else b = 0 ' -- This will cause runtime error (OK)
End Function

Issue Details
Issue Number 527
Project thinBasic
Category Core engine (thinCore.dll)
Status Fixed
Priority 5 - Medium
Affected Version 1.9.16.x
Fixed Version 1.10.0
Milestone (none)
Users able to reproduce bug 1
Users unable to reproduce bug 0
Assigned Users (none)
Tags (none)

08-05-2017 15:34
thinBasic MVPs
I tested Petr's code and got an error right where he pointed too

08-05-2017 17:07
thinBasic author
Will be present in next release

+ Reply