Category:System Variables

Revision as of 00:01, 5 November 2014 by Psanford (Talk | contribs)

System Variables

System variables are variables predefined in Analytica. They help control all kinds of behavior and appearance of Analytica. Most of the options in the Preferences dialog and other dialogs set System variables. For example, in the Uncertainty Sample tab in Uncertainty Setup dialog, you can set the Sample size. This sets a System variable Samplesize.

You can refer to System variables in expressions. For example, you could define a function to estimate the standard error in the estimate of the mean of x of a Monte Carlos sample as:

Function Error_in_mean(x) := Sdeviation(x)/Sqrt(SampleSize)

You can also change the values of some System variables directly by assigning to them in the Typescript or in a Script attribute of Button or user input variable.

Some System variables are not accessible directly from user-interface dialogs (unlike Samplesize, for example). Many of these are esoteric or obsolete, but a few listed below are often quite useful. The best way to modify these is via the Typescript window. Press Ctrl-' (control key and single quote) to open this Window.

See also:

There are more than 160 system variables. The full list can be viewed by typing list sysvar in the typescript window. Some are esoteric or obsolete and only exist for compatibility with legacy models. The most useful ones are those that are not already accessible through the UI and are potentially useful for access in the typescript window either for setting new values or for referencing the current value. This page focuses on the most useful system variables.


  • AttributeFontSize

This sets the font size in the attribute pane and object windows. This setting is also accessible in the UI by selecting Preferences from the Edit menu. The check box labeled Large text in attributes & tables toggles between 10 point and 13 point. (The UI setting also affects TableFontSize.) Other font sizes can be chosen through the typescript window. Since this is a preference value, its value sticks to Analytica rather than being saved to a particular model.


  • TableFontSize

This sets the font size in tables and results. This setting is also accessible in the UI by selecting Preferences from the Edit menu. The check box labeled Large text in attributes & tables toggles between 10 point and 13 point. (The UI setting also affects AttributeFontSize.) Other font sizes can be chosen through the typescript window. Since this is a preference value, its value sticks to Analytica rather than being saved to a particular model.


  • AutoSaveFilename

This is a non-editable read-only variable. It shows the file path Analytica is currently using to save the recovery file. Referencing this variable in the typescript window is a convenient way to locate the last saved recovery file.


  • InternalSDKErrTries

The Frontline optimization engines sometimes fail to compute, and return an SDK error. This is a known issue that Frontline has ameliorated but not fully resolved (as of Analytica 4.5). The occurrence of these errors is not predictable. When one occurs, it is possible that the next optimization with run with no problems. This system variable determines the number of consecutive errors and automatic restarts Analytica will allow without faulting. If you are getting frequent SDK errors with InternalSDKErrTries = 0, try setting it to 5 or so. The value of this variable sticks to an individual model. The default value for new models is 0.


  • It

When you are using typescript for calculations by entering Analytica expressions, It refers to the last result. For example: > pi*2 returns 6.28 > It * 2 then returns 12.57


  • Sv__DateOriginOffset

This setting is accessible in the UI by selecting Preferences from the Edit menu. If Use Excel date origin is unchecked, it will use Jan 1, 1904 as used on Macintosh, corresponding to an offset of zero. If Use Excel date origin is checked, it will use Jan 1, 1900 as used on Excel on Windows. This corresponds to a date offset of -1462.


  • Sys_AllNullTreatment

This is useful for legacy models made with Analytica versions before 4.4. 4.4 changed the way Analytica handles null values is some functions. See What's new in Analytica 4.4?.


  • Sys_AnimateWindows

When set to 1, Analytica will animate windows as they open and close. This is useful for presentations since it gives a visual cue whenever a module is opened to a window. This feature is deactivated by default (Sys_AnimateWindows = 0) because some graphics processors fail to redraw properly when it is activated. If your system does not exhibit this problem, you may find it preferable.


  • Sys_DbDatesAsText

This affects how the DBQuery() function handles date values. If dates are imported numerically, they will be processed as dates in Analytica functions. But if this creates problems, set Sys_DbDatesAsText = 1 to suppress date intelligence and handle the imported values as text.


  • Sys_ShowFontsOnPopup

This is active (1) by default. When you select Set Node Style... from the diagram menu, then select Font, you will see the font names displayed in the actual font styles. If this feature is taking up too much processing time or memory, set this variable to 0.


  • Sys_TableCellDefault

This variable sets the default value for table cells when no value has been set the Cell Default attribute. In other words, Sys_TableCellDefault is the default to the default. For new models, the value of Sys_TableCellDefault is 0. If you change it, the new value will be saved with the model. To designate empty text for the default, do not type anything after the colon in the typescript command. ( Sys_TableCellDefault: ) Regardless of Sys_TableCellDefault , you can always use the Cell Default attribute to establish a default value for an individual table. First activate the Cell Default attribute by selecting Attributes... from the Object window. Place a check box next to Cell Default. The attribute will now appear in the object window for tables.


  • Sys_WarnUndefCell

This Boolean variable enables a warning when you try to evaluate a table with one or more undefined cells. For new models, this value is set to 1 (warning enabled). If you edit this variable, the new value will be saved with the model.


  • WarnOnNonIndexedOp

This Boolean variable enables a warning when you omit the index attribute from array reducing functions. Sum() is an example of an array reducing function. It normally has two attributes: The array and the index to operate over. For example: Sum(cost_table, item_index). Analytica will always warn when the array has two or more dimensions and you omit the second parameter. But there is no ambiguity you are operating on a one-dimensional array or an index. In this case, Analytica will either warn or not depending on the value of WarnOnNotIndexedOp . It is always a good idea to include the index parameter regardless of the dimensions of the array. This way you can add new dimensions to the existing model without introducing ambiguities. Although WarnOnNonIndexedOp is not enabled for new models, it is a good idea to enable it if you want to enforce this guideline.