Comments are non-executed sections of code that are ignored by the CitectVBA compiler. Comments allow programmers to describe the purpose of a section of code to facilitate code maintenance.
As in other BASIC programming languages, both the
apostrophe character ( ' ), and the keyword
REMare recognized as the start of a comment in
CitectVBA. All characters following an apostrophe or the keyword
REMare ignored by the CitectVBA
compiler until it reaches the end of the line. Line continuation
characters do not work inside comments.
REM, like all other keywords and most names in CitectVBA, is not case sensitive.
' This whole line is a comment
rem This whole line is a comment
Rem This whole line is a comment
REM This whole line is a comment
Both types of comments can be used on their own separate line, or the apostrophe character can be used to start a comment at the end of a statement on the same line as a statement.
Pump234.AddPoint( 25, 100 ' Add point to pump 234
Everything placed on the same line after an apostrophe is treated by CitectVBA as a comment. If you want to place a comment on the same line as a statement, the comment must be placed last after all statements on that line. Comments cannot be placed between multiple statements on the same line.
Not every line of code requires a comment. In fact, CitectVBA should contain understandable naming structures and be laid out in such a manner as to make comments unnecessary. However, where a complex function, equation, or logic structure is not readily understandable by viewing the code, it is good practice to include a pertinent comment to make the code more understandable when viewed in isolation.