Try OpenEdge Now
skip to main content
ABL Reference
Handle Reference : SESSION system handle
 

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.
r-dstrig.p
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

*Several attributes of the SESSION handle control the execution of ABL code during the current ABL session. This means that the SESSION handle controls the behavior of any code that you are developing and testing, and the OpenEdge ADE toolset. While the tools of the OpenEdge ADE monitor and set the attributes of the SESSION handle to meet their needs, it is possible that the execution of a procedure that sets attributes of the SESSION handle may affect the display and behavior of the OpenEdge ADE toolset.
*The FIRST-PROCEDURE and LAST-PROCEDURE attributes are set or reset when you create or delete the first or last persistent procedure in a session. You can use procedure attributes to navigate the procedure entries, reference information, and manage the user interface for each persistent procedure in the procedure chain accessed by FIRST-PROCEDURE and LAST-PROCEDURE.
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. For information on deleting a persistent procedure, see the DELETE PROCEDURE statement reference entry.
*The FIRST-SERVER and LAST-SERVER attributes are set or reset when you create or delete the first or last server handle in a session. You can use server handle attributes and methods to navigate the current chain of server handles, connect to a running AppServer, reference information on a connected AppServer, access remote persistent procedures running on a connected AppServer, and disconnect from a connected AppServer for each server handle in the chain accessed by FIRST-SERVER and LAST-SERVER.
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.
*Setting the IMMEDIATE-DISPLAY attribute to TRUE can significantly slow performance. However, some code segments may not execute properly with IMMEDIATE-DISPLAY set to FALSE. If a segment of code requires that IMMEDIATE-DISPLAY is TRUE, you should set the attribute to TRUE immediately before the code segment and change it back to FALSE immediately after the segment.
*In Windows, when execution is blocked for input (by a WAIT-FOR statement, for example), the AVM listens for messages from the windowing system. This allows the AVM to multitask properly with other Windows applications. However, if your ABL application performs long processing without blocking for input, then it may not multitask properly because the AVM does not automatically check for messages from the windowing system. To force the AVM to poll for windowing system messages during this time, you can set the MULTITASKING-INTERVAL attribute to a non-zero value. The lower the value, the more often the AVM checks for messages. This may decrease ABL performance. The maximum value is 9999. A value of 0 inhibits polling until ABL blocks for input.
If you set MULTITASKING-INTERVAL to a non-zero value for a code segment, reset it to 0 immediately after that code.
*The AVM sets the TEMP-DIRECTORY attribute to the value you specify for the Temporary Directory (-T) parameter. If you omit the -T parameter, TEMP-DIRECTORY is set to your current working directory.
*The TYPE attribute returns the widget type, PSEUDO-WIDGET.
*Use the SET-WAIT-STATE method to prevent user and system input, and provide visual feedback during a long computation or other background process. The value you pass determines the type of wait message or cursor the windowing system displays for the user. Passing the value "" to SET-WAIT-STATE ends the wait state. Use this method only for long computations or other processes that force the user to wait significantly longer than the usual response time.
*If you set a wait state for your application, the AVM automatically ends the wait state if it displays an alert box, a dialog box, or message update.
*For SpeedScript, the invalid attributes are: APPL-ALERT-BOXES, CONTEXT-HELP-FILE, DATA-ENTRY-RETURN, FIRST-CHILD, HEIGHT-PIXELS, LAST-CHILD, PARAMETER, PIXELS-PER-COLUMN, PIXELS-PER-ROW, SUPPRESS-WARNINGS, SUPPRESS-WARNINGS-LIST, SYSTEM-ALERT-BOXES, THREE-D, TOOLTIPS, V6DISPLAY, WIDTH-PIXELS. The GET-PRINTERS( ) method is invalid for SpeedScript.
*To access the list of all forms created in a session, use the SESSION handle FIRST-FORM and LAST-FORM attributes along with the NextForm and PrevForm properties of the Progress.Windows.IForm interface. In addition, to .NET forms, this list also contains Progress.Windows.FormProxy object references to all ABL windows created in a session, allowing you to manage .NET forms and ABL windows in a common manner. The SESSION handle FIRST-CHILD attribute, NEXT-SIBLING attribute, LAST-CHILD attribute, and PREV-SIBLING attribute only reference the list of ABL windows in a session.

See also

NextForm property, PrevForm property, Progress.Windows.FormProxy class, Progress.Windows.Form class, Progress.Windows.IForm interface