PreviousNextIndex

CURRENT-VALUE function

Returns the current INT64 value of a sequence defined in the Data Dictionary.

Syntax

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

sequence
logical-dbname
Example

The following example finds the current value of the NextCustNum sequence and then looks for Orders with that Customer number:

r-curval.p
DEFINE VARIABLE cur-cust NO-UNDO LIKE Customer.CustNum. 
cur-cust = CURRENT-VALUE(NextCustNum). 
IF CAN-FIND(FIRST Order WHERE Order.CustNum = cur-cust) THEN 
FOR EACH Order NO-LOCK WHERE Order.CustNum = cur-cust,  
  EACH OrderLine OF Order NO-LOCK 
  BREAK BY Order.OrderNum: 
  IF FIRST-OF(Order.OrderNum) THEN 
    DISPLAY Order.OrderNum Order.OrderDate Order.CustNum 
      WITH FRAME order-info CENTERED ROW 2 1 COL. 
    
  DISPLAY OrderLine. 
END. 
ELSE DO: 
  FIND FIRST Customer WHERE Customer.CustNum = cur-cust NO-LOCK NO-ERROR. 
  IF AVAILABLE Customer THEN 
    MESSAGE "No Orders Exist for Customer " + Customer.Name + 
      ", " + STRING(Customer.CustNum) 
      VIEW-AS ALERT-BOX INFORMATION BUTTONS OK TITLE "No Orders". 
  ELSE  
  MESSAGE "Customer number" cur-cust "does not exist." 
    VIEW-AS ALERT-BOX INFORMATION BUTTONS OK TITLE "No Customer". 
END. 

Notes
See also

CURRENT-VALUE statement, DYNAMIC-CURRENT-VALUE function, DYNAMIC-CURRENT-VALUE statement, DYNAMIC-NEXT-VALUE function, NEXT-VALUE function


OpenEdge Release 10.2B
Copyright © 2009 Progress Software Corporation
PreviousNextIndex