Progress
Programming
Handbook


Quoting Built-in Names and Saving {&SEQUENCE} Values

Note that all built-in name values are returned as unquoted strings. You must quote or not quote the name reference according to the 4GL or preprocessor context of the reference.

Thus, a first reference to {&SEQUENCE}:

DEFINE VARIABLE nexti AS INTEGER. 
nexti = {&SEQUENCE}. 

expands to:

DEFINE VARIABLE nexti AS INTEGER. 
nexti = 0. 

A second reference to {&SEQUENCE}:

DEFINE VARIABLE nextc AS CHARACTER. 
nextc = "{&SEQUENCE}". 

expands to:

DEFINE VARIABLE nextc AS CHARACTER. 
nextc = "1". 

Third through sixth references to {&SEQUENCE}, with a value-saving definition:

&GLOBAL-DEFINE OCCURENCE {&SEQUENCE} + 1 
DEFINE VARIABLE triple AS INTEGER EXTENT 3 
    INITIAL [{&SEQUENCE}, {&SEQUENCE}, {&SEQUENCE}]. 
MESSAGE "Definition of triple complete as variable number" {&OCCURENCE} 
    VIEW-AS ALERT-BOX. 

expands to:

DEFINE VARIABLE triple AS INTEGER EXTENT 3 
    INITIAL [3, 4, 5]. 
MESSAGE "Definition of triple complete as variable number" 2 + 1 
    VIEW-AS ALERT-BOX. 


Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095