Variable Debug Syntax

To quickly print information about a variable when debugging, it can be printed with a question mark after the dollar sign, e.g. $?myVar. This will print the variable name, type and all in-context values. In HTML mode, styles and colors are applied to distinguish the output and values from one another; for example, empty values have a light-green background. Even more debug information can be printed with two question marks, e.g. $??myVar, such as script and line number, variable scope, and referenced source variable. Both syntaxes are legal only when printing, i.e. not for parameter passing etc. The format and content of the output is intended for short-term debugging, not production scripts, and may change in a future release. Hit markup (here) and search (here) also do not support this syntax (no hit markup nor search done). These syntaxes were added in version 6. See also <varinfo dump>, here.

In Vortex version 7.03 and later, one of two additional flags may be given after the single or double question mark:

  • + (plus sign)

    Forces HTML-escapement of variable values, regardless of HTML mode.

  • - (minus sign)

    Forces as-is printing (no HTML escapement) of variable values. By default, HTML escapement happens if the script is in HTML mode; using this flag may be useful to avoid escapement when an HTML-mode Web script is being debugged to a log file that is being read as plain text.


Copyright © Thunderstone Software     Last updated: Apr 15 2024
Copyright © 2024 Thunderstone Software LLC. All rights reserved.