Difference between revisions of "PUBLIC"
Yvonnemilne (Talk | contribs) |
Yvonnemilne (Talk | contribs) |
||
Line 4: | Line 4: | ||
==Syntax== | ==Syntax== | ||
− | PUBLIC [< | + | PUBLIC <variable1> [AS <datatype>] [, <variable2> [AS...]...] |
==See Also== | ==See Also== | ||
− | [[DECLARE]], [[DIMENSION]], [[LOCAL]], [[PARAMETERS]], [[PRIVATE]], [[SET COMPATIBLE]] | + | [[ARRAY()]], [[DECLARE]], [[DIMENSION]], [[LOCAL]], [[PARAMETERS]], [[PRIVATE]], [[SET COMPATIBLE]], [[SET STRICT]] |
Line 14: | Line 14: | ||
The PUBLIC statement declares global memory variables or arrays. Memory variables or arrays that have been declared PUBLIC can be shared and modified by all procedures and programs. By default, any variables created at the Recital Terminal Developer development prompt are declared PUBLIC. A PUBLIC memory variable is initially declared as a logical, with a value of .F.. See DECLARE or DIMENSION for more details on array declaration. | The PUBLIC statement declares global memory variables or arrays. Memory variables or arrays that have been declared PUBLIC can be shared and modified by all procedures and programs. By default, any variables created at the Recital Terminal Developer development prompt are declared PUBLIC. A PUBLIC memory variable is initially declared as a logical, with a value of .F.. See DECLARE or DIMENSION for more details on array declaration. | ||
+ | Memory variables and arrays declared with the optional AS <datatype> clause are subject to data type checking when a value is assigned. An attempt to assign a value of an incompatible data type will fail and return error 306. The following <datatype> values can be specified: | ||
+ | |||
+ | * ARRAY | ||
+ | * CHARACTER | ||
+ | * CLASSNAME | ||
+ | * CURRENCY | ||
+ | * DATE | ||
+ | * DATETIME | ||
+ | * LOGICAL | ||
+ | * NUMERIC | ||
+ | * OBJECT | ||
==Example== | ==Example== | ||
<code lang="recital"> | <code lang="recital"> | ||
− | public i, j, k | + | public i as numeric, j as character, k |
</code> | </code> | ||
Revision as of 14:12, 12 November 2009
Purpose
Declare public memory variable
Syntax
PUBLIC <variable1> [AS <datatype>] [, <variable2> [AS...]...]
See Also
ARRAY(), DECLARE, DIMENSION, LOCAL, PARAMETERS, PRIVATE, SET COMPATIBLE, SET STRICT
Description
The PUBLIC statement declares global memory variables or arrays. Memory variables or arrays that have been declared PUBLIC can be shared and modified by all procedures and programs. By default, any variables created at the Recital Terminal Developer development prompt are declared PUBLIC. A PUBLIC memory variable is initially declared as a logical, with a value of .F.. See DECLARE or DIMENSION for more details on array declaration.
Memory variables and arrays declared with the optional AS <datatype> clause are subject to data type checking when a value is assigned. An attempt to assign a value of an incompatible data type will fail and return error 306. The following <datatype> values can be specified:
- ARRAY
- CHARACTER
- CLASSNAME
- CURRENCY
- DATE
- DATETIME
- LOGICAL
- NUMERIC
- OBJECT
Example
public i as numeric, j as character, k
Products
Recital Database Server, Recital Mirage Server, Recital Terminal Developer