Previous Next

SESSION system handle
A handle to the current ABL session object. This object allows you to read and modify the current ABL session context.
Syntax 
 
SESSION [ :attribute | :method ]
attribute
Specifies an attribute of the SESSION system handle.
method
Specifies a method of the SESSION system handle.
Attributes
 
Methods
 
Example 
The following example uses the SESSION:IMMEDIATE-DISPLAY attribute. When dumping or loading records from the database, the procedure displays a running count of records. If IMMEDIATE-DISPLAY is false, no value is shown until all records are dumped or loaded. At that point, the total is shown. To prevent this, IMMEDIATE-DISPLAY is set to true just before the dump or load and then reset to false afterwards.
 
DEFINE VARIABLE i AS INTEGER NO-UNDO.
 
DEFINE SUB-MENU file
  MENU-ITEM viewit LABEL "&View Data"
  MENU-ITEM dumpit LABEL "&Dump Data"
  MENU-ITEM loadit LABEL "&Load Data".
  MENU-ITEM exit   LABEL "E&xit".
DEFINE MENU mbar MENUBAR
  SUB-MENU file LABEL "&File".
 
DEFINE BUTTON b_more LABEL "Next".
DEFINE BUTTON b_exit LABEL "Cancel".
 
DEFINE FRAME cust-frame
  Customer.CustNum SKIP
  Customer.Name SKIP
  Customer.Phone SKIP
  b_more b_exit
  WITH CENTERED SIDE-LABELS ROW 3.
 
DEFINE STREAM cust.
 
PAUSE 0 BEFORE-HIDE.
 
ON CHOOSE OF b_exit IN FRAME cust-frame DO:
  HIDE FRAME cust-frame NO-PAUSE.
  DISABLE ALL WITH FRAME cust-frame.
  LEAVE.
END.  
 
ON CHOOSE OF b_more IN FRAME cust-frame DO:
  FIND NEXT Customer NO-LOCK NO-ERROR.
  IF NOT AVAILABLE Customer THEN
    RETURN.
  DISPLAY Customer.CustNum Customer.Name Customer.Phone
    WITH FRAME cust-frame.
END.
ON CHOOSE OF MENU-ITEM viewit DO:
  ENABLE ALL WITH FRAME cust-frame.
  FIND FIRST Customer NO-LOCK NO-ERROR.
  DISPLAY Customer.CustNum Customer.Name Customer.Phone 
    WITH FRAME cust-frame.
  APPLY "ENTRY" TO b_more.
END.
 
ON CHOOSE OF MENU-ITEM dumpit DO:
  DISABLE TRIGGERS FOR DUMP OF Customer.
  ix = 1.
  SESSION:IMMEDIATE-DISPLAY = TRUE.
 
  OUTPUT STREAM cust TO "customer.d".
  FOR EACH Customer NO-LOCK:
    EXPORT STREAM cust Customer.
    DISPLAY ix LABEL "Records Processed" 
      WITH FRAME rec-info SIDE-LABELS ROW SCREEN-LINES / 2 CENTERED.
    ix = ix + 1.
  END.
  SESSION:IMMEDIATE-DISPLAY = FALSE.
  OUTPUT STREAM cust CLOSE.
END.
 
ON CHOOSE OF MENU-ITEM loadit DO:
  DISABLE TRIGGERS FOR LOAD OF Customer.
  INPUT FROM "customer.d".
  SESSION:IMMEDIATE-DISPLAY = TRUE.
  REPEAT:
    CREATE Customer.
    IMPORT Customer.
    DISPLAY ix LABEL "Records Processed"
      WITH FRAME rec-info SIDE-LABELS ROW SCREEN-LINES / 2 CENTERED.
    ix = ix + 1.
  END.
  INPUT CLOSE.
  SESSION:IMMEDIATE-DISPLAY = FALSE.
END.
 
IF NOT RETRY THEN
ASSIGN CURRENT-WINDOW:MENUBAR = MENU mbar:HANDLE
       CURRENT-WINDOW:VISIBLE = TRUE.
 
WAIT-FOR CHOOSE OF MENU-ITEM exit.
Notes 
*
*
For more information on the attributes of procedure handles, see the Procedure object handle reference entry. For information on creating a persistent procedure, see the RUN statement reference entry. For information on deleting a persistent procedure, see the DELETE PROCEDURE statement reference entry.
*
For more information on the attributes and methods of server handles, see the Server object handle reference entry. For information on creating server handles, see the CREATE SERVER statement reference entry.
*
*
If you set MULTITASKING-INTERVAL to a non‑zero value for a code segment, reset it to 0 immediately after that code.
*
*
*
*
*
*
See also 
NextForm property, PrevForm property, Progress.Windows.FormProxy class, Progress.Windows.Form class, Progress.Windows.IForm interface

Previous Next
© 2013 Progress Software Corporation and/or its subsidiaries or affiliates.