The syntax of Hamster-Scripts is line-oriented, which means, that each statement has to be written in a single line of text (the length of each line is in fact not limited):
| Allowed: |
print( uppercase( "This is a single line" ) ) |
| Not allowed: |
print( uppercase( "This is NOT a single line" ) ) |
Long lines may be split into multiple lines by appending the line-continuation marker "_" to the end of the line. When the script is started, this marker is replaced by a space and the following line-break (and leading whitespace) is removed, so internally this becomes a single line again:
| Allowed: |
print( _
uppercase( _
"You won't believe it, but this is a single line, too!" _
) _
)
|
Comments start with a "#" character, the rest of the line is ignored:
| Allowed: |
# And now, a secret about spammers: print( uppercase( "make money fast" ) ) # They don't have shift-keys! |
| Not allowed: |
print( _ uppercase( "make money fast" ) _ # Not allowed within a line! ) |
There's also a second type of comments, which may be inserted even within a line. These embedded comments are written between {braces}:
| Allowed: |
print( _
uppercase( "make money fast" ) _ {comment within splitted line}
)
|