Connection Information

To perform the requested action, WordPress needs to access your web server. Please enter your FTP credentials to proceed. If you do not remember your credentials, you should contact your web host.

Connection Type

Declaring constants – PB Docs 150 – PowerBuilder Library

Declaring constants – PB Docs 150

Declaring constants

Description

Any PowerScript variable declaration of a standard datatype
that can be assigned an initial value can be a constant instead
of a variable. To make it a constant, include the keyword CONSTANT in
the declaration and assign it an initial value.

Syntax

The following table shows the parameters used to declare constants.

Table 3-5: Constant variable declaration
parameters

Parameter

Description

CONSTANT

Declares a constant instead of a variable.
The CONSTANT keyword can be before or after the access keywords.

access
(optional)

(For instance variables only) Keywords
specifying the access for the constant. For information, see “Access for instance variables”.

datatype

A standard datatype for the constant.
For decimals, you can include an optional value in brackets to specify
the precision of the data. Blobs cannot be constants.

For information about PowerBuilder datatypes,
see “Standard datatypes”.

constname

The name of the constant (must be a valid
PowerScript identifier, as described in “Identifier names “).

value

A literal or expression of the appropriate
datatype that will be the value of the constant. The value is required.
For information, see “Initial values for variables”.

Usage

When declaring a constant, an initial value is required. Otherwise,
a compiler error occurs. Assigning a value to a constant after it
is declared (that is, redefining a constant in a descendant object)
also causes a compiler error.

Examples

Although PowerScript is not case sensitive, these examples
of local constants use a convention of capitalizing constant names:


Document get from Powerbuilder help
Thank you for watching.
Was this article helpful?
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x