FANDOM


LiveCode ignores all Comments. You might think that makes them unimportant, but that is incorrect. Comments are very important, they are for the informational benefit of the code developer.

Developers should put in Comments to describe what each section of code is doing. Then, later on the comments will help remind them of what the code is doing. Also if other developers look over the program, they will appreciate the comments left behind to help them understand the 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 other LiveCode statement. The next four examples are various ways to make comments in LiveCode:

A multi-line example:

/* 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. */

Single-line examples using a hash mark (#):

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

Single-line examples using two dashes (--):

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

Single-line examples 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.