ID : 9107
Public
Function
To declare a local variable with Public attribute.
Syntax
Public variable name As data type[ = initial value][, variable name As data type[ = initial value]]
Guaranteed entry
Description
Declare local variable with Public attribute.
With separator ",", you can declare multiple variables on a line.
Designate data type using the following identifiers.
| Data type | Identifier |
|---|---|
| 整数型 | Integer |
| 单精度实数型 | Single |
| 双精度实数型 | Double |
| 字符串型 | String |
| 矢量型 | Vector |
| 位置型 | Position |
| 连接型 | Joint |
| 齐次变换型 | Trans |
Related Terms
Declaration Statement, Local Variable, Static Attribute, Public Attribute, Dim
Attention
Public attribute cannot be added to I/O type local variable.
As to string type local variable, its data size varies depending on with/without Public attribute.
Initial value will be assigned only when creating a declared variable. In the case of Public local variable, a default will be assigned at the time of compile, not at the task execution.
Example
Public aaa As Integer
Public bbb(10) As Position
Public ccc As Joint = J(10,10,10,10,10,10,0,0)ID : 9107

