Added March 2025
Comments can be inserted into ASB programs in the following ways.
The ! character (exclamation point), anywhere in the line except within a literal quoted string, marks the beginning of a comment. For example:
!--------------------------------------------------------------
writecd #ch, name, rank, serialno ! output comma delimited
Comments can be inserted into the middle of a logical statement that is broken up into multiple physical lines using the & continuation character, provided that each comment is the last thing on the physical line (after the & character), for example:
query$ = "INSERT INTO LineUp (first, second, third) " & ! SQL infield positions
+ VALUES (" + fn'quote$("Who") & ! Who's on first
+ fn'quote$("What") & ! What's on second
+ fn'quote$("I don't know") & ! I don't know is on third
+ ")"
The one exception to the rule that comments auto-terminate at the end of the physical line is if the comment itself ends with the & continuation character, in which case, the following line is treated as part of the comment. This is legacy quirk and is not recommended because it make it far too easy to overlook when viewing your code. In the following example, the assignment statement on the second line may appear to be executable code, but it is actually a continuation of the comment from the previous line due to it ending with the & continuation character:
! this commented line can extend to the next if it ends with &
a = b + c
The statement code REM acts the same as the ! character, and is another legacy method of indicating comments, e.g.
REM This is a comment
print "Hello World" REM and so is this
Yet another option is @@@, which acts the same as REM or !. For example: .
@@@ This is a comment
print "Hello World" @@@ and so is this
And finally, a single @ also serves as a start-of-comment indicator, but only if it is the first non-blank character on the line, e.g.
@ this is a comment
map1 var1, x, 10, @var2 ! the @ in this line is not a comment indicator
History
2025 February, A-Shell 7.0.1768: Add "@" and "@@@" as comment characters.