ID : 9085
Dim
Function
To declare a local variable.
Syntax
Dim variable name As data type[ = initial value][, variable name As data type[ = initial value]]...
Guaranteed entry
Description
Declare a local variable.
More than one local variable can be declared.
Designate data type using the following identifiers.
| Data type | Identifier |
|---|---|
| 整数型 | Integer |
| 单精度实数型 | Single |
| 双精度实数型 | Double |
| 字符串型 | String |
| 矢量型 | Vector |
| 位置型 | Position |
| 连接型 | Joint |
| 齐次变换型 | Trans |
Related Terms
Example
'!TITLE "Declaration of Variable"
' Declare variable in the designated type
Sub Sample_Dim
' Declare aaa as an integer type local variable
Dim aaa As Integer
aaa = 5 + 2
' Declare bbb as a position type local variable
Dim bbb As Position
bbb = CurPos
' Declare ccc as a single precision real number type local array variable of 5 elements
Dim ccc(4) As Single
For n = 0 To 4
ccc(n) = PosZ(CurPos)
Delay 1000
Next
End Sub
ID : 9085

