This article applies to:
Multiple variables may be declared on a line in E-Basic using a single Dim statement. For example:
Dim intCount As Integer, intSelect As Integer, strName As String
The code above declares the Interger (initCount, initSelect) and String (strName) variable on one line.
When declaring multiple variables on a single line, users need to specify the data type for each variable. Any variable that is not specifically declared with a data type is declared as a Variant. For example:
Dim intCount, intSelect As Integer, strName As String
In the code above, strName is declared as a string, and intSelect is declared as an integer. The intCount variable is declared as a Variant because it is not specifically stated to be any other data type.
Declaring multiple variables on the same line saves space, but may also increase the likelihood of error. We recommend not mixing data types on a single line. For example:
Dim intCount As Integer, intSelect As Integer
Dim strName As String
For more information view the E-Prime Command Reference for specifics involving E-Basic (https://pstnet.com/ecr).