Another format for access-right keywords

Description

You can also group declarations of PowerScript variables according to access by specifying the access-right keyword as a label. It appears on its own line, followed by a colon (:).

Syntax

access-right:

{ readaccess } { writeaccess } datatype  variablename

{ access-right } { readaccess } { writeaccess } datatype  variablename

{ readaccess } { writeaccess } datatype  variablename

Within a labeled group of declarations, you can override the access on a single line by specifying another access-right keyword with the declaration. The labeled access takes effect again on the following lines.

Examples

In these declarations, the instance variables have the access specified by the label that precedes them. Another private variable is defined at the end, where private overrides the public label:

Private:

integer ii_a=10, ii_b=24

string  is_Name, is_Address1

Protected:

integer ii_Units

double  idb_Results

string  is_Lname

Public:

integer ii_Weight

string  is_Location="Home"

private integer ii_test

Some of these protected declarations have restricted write access:

Protected:

integer ii_Units

privatewrite double  idb_Results

privatewrite string  is_Lname