FANDOM


A comment is an important part of the script code, though it is ignored by LiveCode. A comment is strictly for the informational benefit of the code developer.

The developer should put in the comment a description of what each section of code is doing. Then, later on the comments will help remind you of what the program is doing. Also, when you have moved on, other developers will appreciate the comments you left behind to help them understand your code.

Since LiveCode ignores comments, you can use them for debugging. If you don't want a particular line of code to execute right now, then make it into a single line comment. Temporarily put one of the single line comment identifiers before that line. Later you can remove the comment identifiers and LiveCode will resume executing that line.

A comment can be on its own line(s), or after any LiveCode statement.

See the next example of multi-line comment:

/*This is an example of a multi-line comment.
It starts with a forward slash and star and
continues over several lines. It ends with a
star and forward slash.*/

An example using a hash mark (#):

                        # Hello, I'm a comment
put 5 into myVar        # Hello, I'm a comment too.

An example using two dashes (--):

                       -- Hello, I'm a comment
put 16 into myNum      -- Hello, I'm a comment too.

An example using two forward slashes (//):

                       // I am a comment
put 65 after myConst   // I am a comment also
Community content is available under CC-BY-SA unless otherwise noted.