Verbosity
Verbosity is an Analytica system variable that controls how much feedback the system gives to users about the processes it is executing, and is therefore useful with debugging.
The variable contains a bit field that controls various functions. The verbosity: 2
bit should always be set: it controls whether certain error messages are reported when parsing definitions.
The value of Verbosity can be set in the Typescript window which opens when you press Ctrl+' (control comma) or the F12 key.
verbosity: <value>
orverb: <value>
Possible values:
1
verbose; controls whether certain error messages are reported when parsing definitions2
fixing: does not print tables unless explicitly requested4
evalTrace: causes each variable evaluation to be printed out8
fileTrace: setting disables certain messages about file operations such as reading, clearing enables those messages16
debug: catch-all mode for messages useful in debugging that don't fit the other categories128
indentTrace: causes the evaluating trace to be indented to show evaluation depth134
= 2 + 4 + 128: starts verbose tracing with indentation indicating the evaluation depth. This reveals where in the loop each variable evaluation was called from256
(new to Analytica 5.0): Sticky. Starting with 5.0, changes made to Verbosity in a model file are ignored while the model is being loaded, and are not saved with your model, unless the value has this bit set. This prevents accidental changes to verbosity that are saved with your model from causing odd behavior.
Example
Let's assume that you get a stack overflow error when evaluating a model that contains some recursive user-defined function (a UDF that calls itself) because the termination condition of the function is not satisfied, and you would like to find out where exactly the infinite loop is occurring. To do that,
- Press Ctrl+' or F12 to open the Typescript Window.
- In the Typescript window, type
Verbosity: 134
to start verbose tracing - Re-evaluate the model until the stack overflow error appears again.
- Examine the trace in the Typescript window.
- Turn tracing back off by typing
Verbosity: 2
If your trace is too long to view in the Typescript window, then use these steps:
- Press Ctrl+' or F12 to open the Typescript Window.
- In the Typescript window, type
Photo "C:\log.txt"
{ the Photo command logs output that is printed to the Typescript window, to a file; pick your own filename }Verbosity: 134
to start verbose tracing
- Evaluate the model until the stack overflow error reappears. After the stack overflow has occurred, press Ctrl+' or F12 again to return to the Typescript window.
- In Typescript, type:
EndPhoto
to stop logging to the log fileVerbosity: 2
to turn tracing back off and to restore the original value of Verbosity
- Open the log file, "C:\Temp\log.txt", in a text editor such as Notepad. The log will contain a series of lines with a number of dots preceding them. Each dot of indentation will indicate one level of recursion, e.g.
....Evaluating Spinning_Reserves_Di[Time=1801] dloop=263 . .....Evaluating Minimum_Operating_L3. .....Evaluating Net_Spinning_Reserve[Time=1801] (dynamic) dloop=263 . ......Evaluating Net_Spinning_Reserve[Time=1800] (dynamic) dloop=263 . .......Evaluating Net_Spinning_Reserve[Time=1799] (dynamic) dloop=263 . ........Evaluating Net_Spinning_Reserve[Time=1798] (dynamic) dloop=263 . .........Evaluating Net_Spinning_Reserve[Time=1797] (dynamic) dloop=263 . ..........Evaluating Net_Spinning_Reserve[Time=1796] (dynamic) dloop=263 . ...........Evaluating Net_Spinning_Reserve[Time=1795] (dynamic) dloop=263 .
Enable comment auto-refresher