Microsoft KB Archive/81948

= Microsoft Knowledge Base =

Must Explicitly DIM Arrays in TestBasic
Last reviewed: October 19, 1994

Article ID: Q81948

The information in this article applies to:

- Microsoft Test for Windows, versions 1.0 and 2.0

SUMMARY
Microsoft Test TestBasic does not support implicit array dimensioning; you must explicitly DIM any arrays you want to use in your program. This is by design.

MORE INFORMATION
One drawback of requiring explicit array dimensioning is that if you have code such as

Print MyArray(1) and MyArray is not declared as an array or function, then you will get the following as output:

0 1 0 = value of implicitly dimmed variable MyArray, and 1 = the literal 1 in parentheses.

This can mean that if you misspell a function or array name, you may get an error (as above) that may be difficult to track down.

You might also receive a &quot;Syntax Error&quot; message if you try to assign a value to an implicitly DIMensioned array:

MyArray(1) = 6 This will give you an error and highlight the left parenthesis.