ChardScript Comments

Comments can be used to explain ChardScript code, make the code more readable and prevent execution when testing code.

Creating a Comment

Comments starts with a #, and ChardScript will ignore them:

Example

# This is a comment
echo("Hello World!")

Comments can be placed at the end of a line, and ChardScript will ignore the rest of the line:

Example

echo("Hello World!") # This is a comment

A comment does not have to be text that explains the code, it can also be used to prevent ChardScript from executing code:

Example

# echo("Hello World!")
echo("Comment will not work!")

Multi Line Comments

ChardScript does not really have a syntax for multi line comments.

To add a multiline comment you could insert a # for each line:

Example

# This is a comment
# written in
# more than just one line
echo("Hello, World!")

Last updated