Variables window

BASin

Variables window

The Variables window is available from the View menu.

Variables window

This window keeps a list of any variables that have been declared at runtime or as a Direct Command with a LET statement. Once the variable has been declared, it will appear in the list. The name will show at the far left of the window, followed by its type:

  • Numeric - a variable that holds either a floating point (decimal) number or an Integer (whole) number.
  • String - a variable that contains a string of ASCII characters.
  • For Var - a numeric, single letter variable, that contains information about the FOR command that created it. The current value, the STEP value, and the limit (TO value) is shown.
  • NumArray - a numeric array. The dimensions of the array are also shown.
  • StrArray - an array of strings. As for the numeric array, the dimensions are also shown with the type.

After this, the contents of the variable are shown. This display will update in real-time as the program changes the variable contents.

You can use either a click of the right mouse button on the highlighted variable, or use one of the two buttons at the bottom-left of the window to either edit the variable or watch it.

If you elect to watch the variable, then a Watch will be created and added to the Watch Window containing the variable name as it's watch-expression. You can edit this watch with the Watch Properties window.

Editing a simple String or Numeric variable

Editing variables brings up the variable editor. The contents of this window depend upon the type of variable being edited.

Editing a numeric variableEditing a string variable

For a simple numeric or string variable, you can alter the contents by typing a new expression into the variable editor's edit field. This expression must be of correct syntax, and evaluate to the type of variable being edited. This means, for example, that any string literals you edit must be enclosed in quote (") marks, but does grant the ability to use such expressions as A$+B$ or "Hello"( TO 4) which will of course be evaluated when you click OK, and the result stored in the variable.

Editing a FOR control variable

Editing a FOR control variable

A FOR variable will, when edited, allow you to alter the current value, the STEP value, and the limit (the TO value), as well as the line and statement number that the corresponding NEXT statement will jump to when the loop is processed. Note that if the FOR variable is declared as a direct statement, the line to jump to will be 65534, i.e. an impossible jump. Again, all the edit fields will accept any numeric expression as their contents.

Editing an array variable

Editing a numeric array variable

Numeric or String arrays will present themselves as a list in the variable editor of their contents. Clicking any of the elements will open an edit field for that element, which again can be any expression relevant to the variable type.