Identifier names

Description

You use identifiers to name variables, labels, functions, windows, controls, menus, and anything else you refer to in scripts.

Syntax

Rules for identifiers:

Usage

By default, PowerBuilder allows you to use dashes in all identifiers, including in variable names in a script. However, this means that when you use the subtraction operator or the -- operator in a script, you must surround it with spaces. If you do not, PowerBuilder interprets the expression as an identifier name.

If you want to disallow dashes in variable names in scripts, you can change the setting of the Allow Dashes in Identifiers option in the script editor’s property sheet. As a result, you do not have to surround the subtraction operator and the decrement assignment shortcut (--) with spaces.

NoteBe careful If you disallow dashes and have previously used dashes in variable names, you will get errors the next time you compile.

Examples

Valid identifiers

ABC_Code

Child-Id

FirstButton

response35

pay-before%deductions$

ORDER_DATE

Actual-$-amount

Part#

Invalid identifiers

2nd-quantity // Does not start with a letter

ABC Code     // Contains a space

Child'sId    // Contains invalid special character