lvar( )

Description

This will generate a 'report' on the state of the script environment. This report will either (RISC OS) be written to the logfile; or (Windows) to a text file which will be opened in Notepad.

Examples

Here is an example of the RISC OS report, taken from the end of a successful execution of the "weathrtest" script:
LVAR (weathrtest)
=================

Integer variables:
  A = 0
  B = 0
  C = 0
  D = 0
  E = 0
  F = 3
  G = 4
  H = 0
  I = 0
  J = 0
  K = 0
  L = 25
  M = 15
  N = 0
  O = 0
  P = 0

Float variables:
  Q = 0
  R = 0
  S = 0
  T = 0
  U = 0
  V = 0
  W = 0
  X = 0
  Y = 0
  Z = 59

Branch positions:
  frameloop,           266; 17
  lineloop,            315; 21

Miscellany:
  Script file handle   254
  User file handle     253
  Current line number  50

And here is an example of the Windows report, taken from the end of a successful execution of one of the test scripts:

LVAR - Test script: 'Call' system
=================================

Integer variables:            Float variables:
  A = 0                         Q = 0
  B = 0                         R = 0
  C = 0                         S = 0
  D = 0                         T = 0
  E = 0                         U = 0
  F = 0                         V = 0
  G = 0                         W = 0
  H = 0                         X = 0
  I = 0                         Y = 0
  J = 0                         Z = 0
  K = 0
  L = 0
  M = 0
  N = 0
  O = 0
  P = 0

Branch positions:
  Offset  Line  Name
  152       14  one
  242       20  two
  345       27  three
  457       33  four

Call stack:
    4 --> +398   line  30
    3 --> +290   line  23
    2 --> +194   line  17
    1 --> +101   line   6

Miscellany:
  Script file reference  2
  User file reference    No file open
  (Last) User file name  ""

  Last error message     (no errors encounted)

  Current line (content) "lvar()"
  Current line (linenum) 37
  Current line (offset)  510
  Size of script (lines) 39
  Size of script (bytes) 722

  Most recent channel    55
  Most recent page fetch 100

  WinTTX version         1.50r0 (2008/08/08)
  PtrIIC version         0.10
  Cable known connected? Yes

[end of status report]

Specifics

It can sometimes be difficult to work out what exactly a syntax error message is saying. For this reason, WinTTX has an option where you can perform an implicit "lvar" upon a script error, which makes it so much easier to track down errors.

The report files in Windows are stored in your Temp path, with a filename such as "ScrLog_0808082208-3853.txt", which my be broken down as "yy mm dd hh mm ss - tttt" (where 'tttt' is the last four digits of the value of the system ticker so no two files will have the same name).
These files are not currently deleted by WinTTX, you will need to periodically tidy Temp yourself.

Under RISC OS, this command needs a RAMdisc to be active as it writes to "RAM::RamDisc0.$.ttxscrplog" - if the file exists, the report will be appened. If the file does not exist, it will be created.