Identifier names – PB Docs 2017

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:

  • Must start with a letter or an _ (underscore)

  • Cannot be reserved words (see Reserved words)

  • Can have up to 40 characters but no spaces

  • Are not case sensitive (PART, Part, and part are
    identical)

  • Can include any combination of letters, numbers, and these
    special characters:

    – Dash

    _ Underscore

    $ Dollar sign

    # Number sign

    % Percent sign

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.

Be 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

Invalid identifiers


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