Comments: Difference between revisions

From ASCEND
Jump to navigation Jump to search
No edit summary
No edit summary
Line 13: Line 13:
</source>
</source>


Comments can be nested (note that in some text-editors, this can confuse the [[syntax highlighting]], but it still works fine in ASCEND). This can be useful, in particular, for temporarily removing parts of the model, e.g. during testing/debugging.
Comments can be '''nested''' (note that in some text-editors, this can confuse the [[syntax highlighting]], but it still works fine in ASCEND). This can be useful, in particular, for temporarily removing parts of the model, e.g. during testing/debugging.


<source lang=a4c>
<source lang=a4c>

Revision as of 06:27, 12 December 2013

In ASCEND syntax, comments can be written within the special delimiters (* and *).

Example:

(*
    This model is very useless, because it doesn't have
    any equations in it yet.
*)
MODEL mymodel;
    d IS_A distance; (* pipe diameter *)
    h IS_A distance; (* change in height *)
END mymodel;

Comments can be nested (note that in some text-editors, this can confuse the syntax highlighting, but it still works fine in ASCEND). This can be useful, in particular, for temporarily removing parts of the model, e.g. during testing/debugging.

MODEL mymodel;
    d IS_A distance; (* pipe diameter *)
    (* h IS_A distance; (* change in height *) --we don't need this any more *)
END mymodel;