PowerBASIC Users Meeting Point
trailing semicolon? - Printable Version

+- PowerBASIC Users Meeting Point (https://pump.richheimer.de)
+-- Forum: User to User Discussions (https://pump.richheimer.de/forumdisplay.php?fid=3)
+--- Forum: PowerBASIC for Windows (https://pump.richheimer.de/forumdisplay.php?fid=4)
+--- Thread: trailing semicolon? (/showthread.php?tid=141)



trailing semicolon? - Dan Soper - 14.10.2026

I'm sure this has come up before, but probably on the old forum.

In a code module translated from C, I inadvertently left a line-end semicolon behind, resulting in:

Code:
END TYPE;

As far as I'm aware this is not valid, and shouldn't compile - but it did!

What am I getting wrong here? Is is somehow valid PB syntax?


RE: trailing semicolon? - Borje Hagsten - 14.10.2026

It is for comment in an Inline Assembler statement. See PB Help - REM statement: 
Syntax
REM comment text
' comment text
; comment in an Inline Assembler statement

Should add - a semi colon alone is ok to set anywhere, but will only work as remark in  Inline Assembler statements.


RE: trailing semicolon? - Dan Soper - 15.10.2026

Hi Borje,

Thanks for the explanation. So a trailing semicolon is basically ignored everywhere*, but it only treated as a comment marker in Assembler? Seems like a compiler bug to me. 


* it is meaningful in some places, e.g. at the end of a PRINT statement. The inconsistency makes me think this is not intended behaviour.


RE: trailing semicolon? - Borje Hagsten - 15.10.2026

Quick test shows it's not ignored everywhere, but doesn't matter what Bob had intention to do with it or if it is a "feature", because there will be no more versions of PB compilers. Apapt, overcome and move on.. Smile