Thanks for reporting.
Error in thinAir parsing IF. It expects THEN keyword as last token in IF statement to decide if single or multiple line IF statement.
I need to remove comments before parsing
Will fix soon
This code has a comment at the end of the "If...then" line.
This results in an error message being displayedIf strTempValue = "C" Then ' Celsius strCommand = "DEGC" Else 'Fahrenheit strCommand = "DEGF" End If
"Block warning: End of IF block found, but no matching beginning."
The error message will go away if the trailing comment is removed.
Should we simply avoid placing a comment on the same line after the "then" keyword?If strTempValue = "C" Then strCommand = "DEGC" Else 'Fahrenheit strCommand = "DEGF" End If
Thanks for reporting.
Error in thinAir parsing IF. It expects THEN keyword as last token in IF statement to decide if single or multiple line IF statement.
I need to remove comments before parsing
Will fix soon
www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000
Yes you are right.
I need to fix it asap, it is very annoying.
Just released thinBasic 1.13
Will work on this
www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000
Forgot to mention ...
thinBasic version 1.13 should have this bug fixed in thinAir.
https://www.thinbasic.com/downloads.html#downloads
If you can, please confirm it or just give me some examples not working
As you may know thinBasic is able to parse also some different kind of comments like double // or single or multi line comments between /* ... */ used in other programming languages.
Also those kind of commenting methods should now work at the end of a IF line
www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000
Yeah, you should avoid putting comments on the same line as the "Then" keyword. Some compilers or interpreters don't handle inline comments well in control structures like this. Best practice is to place comments on their own line above or below the code to prevent these errors.
Yeah, definitely avoid comments right after the "Then" in an If statement.
Bookmarks