Scripts - System variables
System variables are predefined variables that set options and control program operation. They always start with a $ symbol. System variable names, as other variable names, functions and commands in MedCalc, are case-insensitive.
System variables can be changed, and can be used in calculations, conditional statements, etc.
General system variables
$DecimalSymbol | The character used as decimal symbol (see Regional settings). |
$ListSeparator | The character used as list separator (see Regional settings). |
$PrecisionInc | The "precision increment" as set in Reports options. |
$Chrono | A timer in milliseconds. The timer has a resolution in the range of 10 milliseconds to 16 milliseconds. |
System variables that control the spreadsheet
$Century | The default century when entering dates without the century (as set in Spreadsheet options). |
$DefaultAlignment | The default alignment in the MedCalc spreadsheet, as set in Format spreadsheet. Possible values: RIGHT | LEFT | CENTER. |
$DefaultColumnwidth | The default column width of the MedCalc spreadsheet, as set in Format spreadsheet. |
$DefaultPrecision | The default precision (number of decimals) of the MedCalc spreadsheet, as set in Format spreadsheet. |
$ListSeparator | The character used as list separator (see Regional settings). |
System variables used in Custom dialogs:
$DlgVar1 .. $DlgVar4 | The variables selected in a custom dialog box. |
$DlgFilter | The filter selected in a custom dialog box. |
$Covariates[1..24] | The covariates selected in a custom dialog box |
$Option1 .. $Option5 | Options selected in a custom dialog box. |
$Input .. $Input4 | Values entered in a custom dialog box. |
System variables that control script execution
$Output | When set to MAIN, output, reports, and graphs are displayed in the MedCalc main window. When set to CONSOLE, reports and graphs are displayed in the output frame of the scripts window. When set to OFF, reports and graphs are not displayed. When set to ON, the output setting is reset to its previous state, before OFF (reset to MAIN or CONSOLE). |
$Autoload | This variable is set to TRUE by MedCalc during execution of an Autoload script. |
System variables that set graph options
$ColorScheme | Possible values: [1..4] |
$GraphFont | Font name |
$DisplayGrid | possible values: TRUE | FALSE |
$PlotAreaBorderXYonly | possible values: TRUE | FALSE |
$OutsideTickmarks | possible values: TRUE | FALSE |
$Jitter | possible values: TRUE | FALSE |
$Title | Graph title (top) (*) |
$XTitle | Text below X-axis (*) |
$YTitle | Vertical text left of Y-axis(*) |
(*) If $Title is empty, the default title is used. If $Title="NULL" then there will be no title in the graph.
System folders
$DataPath | Folder where data files are stored |
$GraphsPath | Folder where image files are stored |
$TextPath | Folder where text files are stored |
$ScriptsPath | Folder where scripts are stored |