Comments: Difference between revisions

S-BASIC example
(Add lang example)
(S-BASIC example)
Line 2,825:
=={{header|Sather}}==
<syntaxhighlight lang="sather">-- a single line comment</syntaxhighlight>
 
=={{header|S-BASIC}}==
<syntaxhighlight lang="BASIC">
rem S-BASIC supports traditional BASIC-style comments
 
comment
In addition to the single-line REM statement, S-BASIC
also supports multiline comments using COMMENT...END.
Note that the terminating END must be the first token on
a line of its own.
end
 
comment
When declaring a group of variables, S-BASIC allows
a semi-colon, instead of the normal comma, as a separator,
in which event an explanatory comment can follow the
semi-colon and is ignored by the compiler.
end
 
var n ; number of payments over life of loan
ppy ; payments per year
apr ; annual interest rate as a decimal
amt ; principal amount of loan
pmt ; amount of periodic payment
= real
 
comment
Finally, although statements in S-BASIC are normally terminated
by an end-of-line, any logical statement can be continued on to
the following physical line with a backslash, in which event
anything after the backslash is ignored and can be used for
a comment.
end
if amt = 0 then \ user forgot to enter a value
print "Must specify a loan amount!"
end
<\syntaxhighlight>
 
=={{header|Scala}}==
211

edits