ID : 5168
GetPublicValue
Function
To load a Public local variable.
Syntax
GetPublicValue receiving variable, task name, Public variable name[, dimension 1_Index [, dimension 2_Index[, dimension n_Index]]]
Guaranteed entry
- Receiving variable
- Designate a variable that the value of Public variable assigned to.
- Task name
- Designate a task name by string type data. Refer to "Program File and Task."
- Public variable name
- Designate a Public local variable to be loaded by string type data.
- Dimension n_Index
- Designate an Index number of each dimension by integer type data when a Public attribute variable you load is an array.
Description
Load local variable with Public attribute.
You can also load array. In this case, Public local variable and receiving variable which is assigned to need to be identical on data type, dimension number and element number.
Related Terms
Public Attribute, SetPublicValue, Static Attribute, Static, Dim, Static, Declaration Statement, Local Variable
Attention
Argument for designating Public local variable, "task name" and "Public variable name" are designated by string type data.
Example
'Program name Pro1
' Program which declares Public attribute variable
Public pubVal As Integer = 5
Public pubPos(5) As Position
'Program name Test1
Sub Main
Dim aaa As Integer
GetPublicValue aaa, "Pro1", "pubVal" 'Load Public variable "pubVal" of "Pro1"
Dim bbb As Position
GetPublicValue bbb, "Pro1", "pubPos", 2
'Load an element of Index number 2 of Public variable "pubPos" which is an array of "Pro1"
Dim ccc(5) As Position
GetPublicValue ccc, "Pro1", "pubPos"'Load Public variable "pubPos" which is an array of "Pro1"
End Sub
ID : 5168