A Dim/Var Statement creates only one new object at a time
From Xojo Documentation
(Redirected from A Dim Statement creates only one new object at a time)Error message
You used the optional New operator in a Var statement to instantiate two or more objects. You cannot use the New operator in a Var statement that declares more than one variable. You can, for example, declare multiple variables with the Var statement and then use separate statements to instantiate them. Your other option is to use the optional New operator in separate Var statements.
This error and the explanation of it applies to the Dim statement as well. |
Sample Code
The following statement produces this error:
Either of the following is correct. In the first case, all variables are declared in one statement and instantiated separately.
Using separate Dim statements: