Progress
Language Reference


CURRENT-VALUE Statement

Interfaces
OS
SpeedScript
All
All
Yes

Resets the current integer value of a sequence defined in the Data Dictionary.

SYNTAX

CURRENT-VALUE ( sequence [ , logical-dbname ] ) = expression 

sequence

An identifier that specifies the name of a sequence defined in the Data Dictionary.

logical-dbname

An identifier that specifies the logical name of the database in which the sequence is defined. The database must be connected. You can omit this parameter if the sequence name is unambiguous. If more than one connected database has a sequence with given name, then you must supply logical-dbname.

expression

An integer expression assigned as the current value of the specified sequence. If expression is outside the boundary set by the initial value (at one end) and the lower limit or upper limit (at the other end) for the sequence, Progress returns an error, and the sequence value remains unchanged.

EXAMPLE

The following example resets the current value of the next-cust-num sequence to the cust-num value of the last customer record if that is a valid value for the sequence.

r-curvl1.p
FIND LAST customer NO-LOCK.

IF customer.cust-num < CURRENT-VALUE(next-cust-num) AND
   customer.cust-num > 1000
THEN DO:
   CURRENT-VALUE(next-cust-num) = customer.cust-num.
   MESSAGE "The value of next-cust-num has been changed to"
           customer.cust-num VIEW-AS ALERT-BOX INFORMATION BUTTONS OK.
END.
ELSE MESSAGE "The value of next-cust-num remains"
             CURRENT-VALUE(next-cust-num)
             VIEW-AS ALERT-BOX INFORMATION BUTTONS OK. 

NOTES

SEE ALSO

CURRENT-VALUE Function, NEXT-VALUE Function


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