OPERATORS

Work area alias (->)

Read or write a field in the named work area.

Syntax

Signature
alias->field
FIELD->field
alias->( expression )

Description

Read or write a field in the named work area. FIELD selects the current area. Parentheses after the arrow evaluate an expression in the selected area. Parentheses around an alias variable use its value as the work area selector.

Example

Work_area_alias.prg
PROCEDURE Main()

   LOCAL nOriginal := Select()
   LOCAL nArea

   // Inspect two areas and show which area is current after each expression.
   FOR EACH nArea IN { 1, 2 }
      QOut( "Inside selected area", ( nArea )->( Select() ) )
      QOut( "Back in original area", Select() == nOriginal )
   NEXT

   RETURN

Output