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

Scripts - Statements and comments

Statements

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

This is an example of an asignment statement:

k=0;

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):

{
k=2;
k=k*2;
}

Comments

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.

url="http://www.medcalc.org";

See also