<< Prev        Next >>

ID : 5166

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

Variable name
Designate a variable name. Each name must be specified in accordance with the Naming convention. Also an Array can be declared.
Data type
Designate data type of the local variable for declaration.
Initial value
Designate a value to be assigned when variable declaration. Designate constant.

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 Type Integer
Single Precision Real Number Type Single
Double Precision Real Number Type Double
String Type String
Vector Type Vector
Position Type Position
Joint Type Joint
Homogeneous Translation Type Trans

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 : 5166

<< Prev        Next >>