Revision as of 20:32, 21 May 2019 by Ldavidson (talk | contribs) (→‎Example)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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> or verb: <value>

Possible values:

1 verbose; controls whether certain error messages are reported when parsing definitions
2 fixing: does not print tables unless explicitly requested
4 evalTrace: causes each variable evaluation to be printed out
8 fileTrace: setting disables certain messages about file operations such as reading, clearing enables those messages
16 debug: catch-all mode for messages useful in debugging that don't fit the other categories
32 evaluating: this is mostly set internally in code; this gets rid of certain messages about undefined variables etc. if set
64 fixingTrace: gives some extra output for processing of definitions
128 indentTrace: causes the evaluating trace to be indented to show evaluation depth
134 = 2 + 4 + 128: starts verbose tracing with indentation indicating the evaluation depth. This reveals where in the loop each variable evaluation was called from
256 (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.


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,

  1. Press Ctrl+' or F12 to open the Typescript Window.
  2. In the Typescript window, type Verbosity: 134 to start verbose tracing
  3. Re-evaluate the model until the stack overflow error appears again.
  4. Examine the trace in the Typescript window.
  5. Turn tracing back off by typing Verbosity: 2

If your trace is too long to view in the Typescript window, then use these steps:

  1. Press Ctrl+' or F12 to open the Typescript Window.
  2. 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
  3. 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.
  4. In Typescript, type:
    EndPhoto to stop logging to the log file
    Verbosity: 2 to turn tracing back off and to restore the original value of Verbosity
  5. 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 .

See Also


You are not allowed to post comments.