Dim Action

Declares a variable and allocates storage space.

Use

When you use a Dim action in a macro, you generally put the Dim action at the beginning of the macro.

Parameters

Variable  -  (Required)

Name of the variable.  

Type  -  (Required)

Data type of the variable. This can be either a pre–defined data type or a user–defined type defined with the Type action.

The predefined data types are Byte, Boolean, Integer, Long, Single, Double, String, String *, WString, and WString *.  

Example

The following example declares a string variable then assigns a value to that variable.

Dim (myTown, String)

SetValue (myTown, "Hillside Views")

 

The following example creates a custom array type, declares a variable of that type and assigns values to the variable.

Type (StateData, Zipcode() As String, Suburb() As String)

Dim (Vermont, StateData)

SetValue (Vermont.Zipcode(0), 12345)

SetValue (Vermont.Suburb(0), "Shady Grove")

SetValue (Vermont.Zipcode(1), 65432)

SetValue (Vermont.Suburb(1), "Viewtown")

SetValue (Vermont.Zipcode(2), 64567)

SetValue (Vermont.Suburb(2), "Forest Hills")

See Also

Type action | SetValue action


© 2004-2021 looksoftware. All rights reserved.