Skip to main content
Mail a PDF copy of this page to:
(Your email address will not be added to a mailing list)
Show menu

Scripts - Statements and comments


A MedCalc script is a set of instructions - called statements - to be executed by the program.

This is an example of an asignment statement:


In this example, a workspace variable with the name k is created and the value 0 is assigned to it.

A compound statement, or statement block, is a construct with several simple statements enclosed with braces (curly brackets):



The script can contain comments; this is text that will completely be ignored by the program.

A comment starts with // (two slashes). Any text between the comment marker // and the end of the line are ignored when you run the script.

k=5; // create variable k and assign the value 5 to it

Two slashes can be used in a string constant without indicating a comment.


See also