Progress
Language Reference


SESSION System Handle

Interfaces
OS
SpeedScript
All
All
Yes

A handle to the current Progress session object. This object allows you to read and modify the current Progress session context.

SYNTAX

SESSION [ :attribute | :method ] 

attribute

Specifies an attribute of the SESSION handle. The attributes are listed below.

Attribute
Type
Description
LOGICAL
If TRUE, the output from all MESSAGE statements in the application are displayed in alert boxes.
LOGICAL
Specifies whether the current session is running in batch mode.
CHARACTER
Returns the setting for the Character Set (-charset) parameter. This attribute is obsolete. See the CPINTERNAL Attribute.
CHARACTER
Returns the type of Progress client currently executing.
CHARACTER
Specifies the path name of a help (.HLP) file associated with a session.
CHARACTER
Indicates the case table Progress uses to establish case rules for the memory code page (-cpinternal).
CHARACTER
Indicates the collation table Progress uses with the memory code page (-cpinternal).
CHARACTER
Indicates the internal code page Progress uses in memory (-cpinternal).
CHARACTER
Indicates the code page for all messages written to the log (.lg) file.
CHARACTER
Indicates the code page Progress uses for the OUTPUT TO PRINTER statement.
CHARACTER
Indicates the code page Progress uses to convert text strings into the text segment.
CHARACTER
Indicates the code page Progress uses at compile time to convert text strings into the text segment and marks the text segment with the code page name.
CHARACTER
Indicates the stream code page Progress uses for stream I/O (-cpstream).
CHARACTER
Indicates the code page Progress uses for I/O with character terminals.
LOGICAL
If TRUE, the RETURN key acts like a TAB in a fill-in. Otherwise, the window system handles the return.
CHARACTER
Indicates the format used to represent dates. Typical values are mdy or dmy. This attribute provides the same functionality as the Date Format (-d) parameter.
LOGICAL
Indicates whether Progress provides access to 4GL stack trace information when an error occurs (TRUE) or not (FALSE).
CHARACTER
Specifies the display type for the session: either TTY (character) or GUI (graphical).
HANDLE
A handle to the first table that has a buffer object.
HANDLE
A handle to the first window within the Progress display.
HANDLE
A handle to the first entry in the chain of persistent procedures for the session.
HANDLE
A handle to the first entry in the chain of server handles for the session.
HANDLE
A handle to the first entry in the list of all valid server socket handles created in the current session.
HANDLE
A handle to the first entry in the list of all valid socket handles created in the current session.
INTEGER
The space between frames in a window, given in display units (character cells for character interfaces and pixels for graphical interfaces).
DECIMAL
The height of the display in characters.
INTEGER
The height of the display in pixels.
CHARACTER
A character string that supplies Internet Component Framework (ICF) procedures with ICF-related data.
LOGICAL
If TRUE, Progress updates the screen for every I/O operation. If FALSE, Progress does not update the screen until a statement blocks for input.
WIDGET-
HANDLE
A handle to the last window within the Progress display.
HANDLE
A handle to the last entry in the chain of persistent procedures for the session.
HANDLE
A handle to the last entry in the chain of server handles for the session.
HANDLE
A handle to the last entry in the list of all valid server socket handles created in the current session.
HANDLE
A handle to the last entry in the list of all valid socket handles created in the current session.
INTEGER
This attribute applies to Windows only. It controls how Progress interacts with Window’s cooperative multitasking.
CHARACTER
Indicates the character that represents, in formatted text, a number’s decimal point.
CHARACTER
Indicates the meanings of commas and periods within numeric values. The possible values are “American”, “European”, or a character string containing the thousands separator followed by the decimal point. This provides the same functionality as the European Numeric Format (-E) parameter.
CHARACTER
Indicates the character that represents, in formatted text, a number’s thousands separator.
CHARACTER
Specifies the value passed to -param for the session.
INTEGER
The number of pixels in each column of the display.
INTEGER
The number of pixels in each row of the display.
INTEGER
This attribute applies to Windows only. The integer identifier of the current context for a print job on Windows.
INTEGER
The handle to the current Windows device context for a print job.
CHARACTER
This attribute applies to Windows only. The name of the currently selected printer.
CHARACTER
This attribute applies to Windows only. The name of the currently selected printer port.
LOGICAL
TRUE if the current session is running in the context of a Progress AppServer.
LOGICAL
(AppServer only) TRUE if the AppServer session is bound to a particular client application. Valid only if the REMOTE attribute is TRUE.
LOGICAL
(AppServer only) When set to TRUE, requests that the AppServer session be bound to the current client connection identified by the SERVER-CONNECTION-ID attribute. When set to FALSE, requests that the the AppServer session be unbound from the currently bound client connection pending deletion of all remote persistent procedures running in the session. Ignored unless the REMOTE attribute is TRUE.
CHARACTER
(AppServer only) An application-determined value that you can set. Progress passes this value to each Application Server process that executes a request on behalf of the client connection identified by the SERVER-CONNECTION-ID attribute. Valid only if the REMOTE attribute is TRUE.
CHARACTER
(AppServer only) Returns the run-time connection ID of the current client connection assigned to this AppServer session. Valid only if the REMOTE attribute is TRUE.
CHARACTER
(AppServer only) Returns the operating mode specified by the operatingMode property set for this AppServer in the ubroker.properties file. Possible values include:
  • "State-reset"
  • "State-aware"
  • "Stateless"
Valid only if the REMOTE attribute is TRUE.
CHARACTER
The setting of the Stream (-stream) parameter. This attribute is obsolete. See the CPSTREAM Attribute.
CHARACTER
A list of the super procedure handles associated with the current Progress session.
LOGICAL
If TRUE, Progress does not display warning messages to the screen during the session.
LOGICAL
If TRUE, system messages are displayed in alert boxes rather than in the message area.
CHARACTER
The name of the directory Progress uses to store temporary files for the session.
LOGICAL
This attribute applies to Windows only. If TRUE, system dialog boxes and alert boxes are displayed in three-dimensional format.
CHARACTER
Specifies whether the source for time (TIME function value) is the client or database server machine.
LOGICAL
This attribute applies to Windows only. If TRUE, then ToolTip information that is defined for any controls associated with a given session displays when the mouse pointer pauses over a control. Otherwise, ToolTip information does not display for any controls in the session.
CHARACTER
The SESSION handle widget type, PSEUDO-WIDGET.
LOGICAL
This attribute applies to Windows only. If TRUE, Progress uses Version 6 display rules for the session.
DECIMAL
The display width in character units.
INTEGER
The display width in pixels.
CHARACTER
The windowing system - specifically, MS-WIN95, MS-WINDOWS, or TTY.
INTEGER
Indicates the height of the work-area in pixels.
INTEGER
The starting x-coordinate (the upper left-hand corner) of the work-area in pixels.
INTEGER
The starting y-coordinate (the upper left-hand corner) of the work-area in pixels.
INTEGER
Indicates the current start date for the Progress two-digit year-range of 100 years. Typical values are 1920 or 1950. This attribute provides the same functionality as the Year Offset (-yy) parameter.

method

Specifies a method of the SESSION handle.

Method
Return Type
Description
LOGICAL
Associates a super procedure file with the current Progress session.
EXPORT( ) Method ( [ list ] )
LOGICAL
(AppServer only) Creates and modifies the list of remote procedures provided by the AppServer.
CHARACTER
Returns a comma-separated list of printers defined in the Windows Registry.
CHARACTER
Returns a string indicating the current wait-state.
LOGICAL
Dissociates a super procedure file from the current Progress session.
SET-NUMERIC-FORMAT( ) Method ( separator , decimal-point )
LOGICAL
Sets the NUMERIC-SEPARATOR and NUMERIC-DECIMAL-
POINT attributes simultaneously.
LOGICAL
Sets the type of wait state, GENERAL, COMPILER, or "". Use this method to prevent user and system input, and provide visual feedback during a long computation or other process. The value you pass determines the type of wait message or cursor that the windowing system displays for the user. The value "" ends the wait state.

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 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.cust-num SKIP
  customer.name  SKIP
  customer.phone SKIP
  b_more b_exit
  WITH CENTERED SIDE-LABELS ROW 3.
   
DEFINE STREAM cust.

DEFINE VARIABLE i AS INTEGER NO-UNDO.

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.cust-num 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.
  DISP customer.cust-num 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.
  i = 1.
  SESSION:IMMEDIATE-DISPLAY = TRUE.
  OUTPUT STREAM cust TO "customer.d".
  FOR EACH customer NO-LOCK:
    EXPORT STREAM cust customer.
    DISP i LABEL "Records Processed" 
      WITH FRAME rec-info SIDE-LABELS ROW SCREEN-LINES / 2 CENTERED.
    i = i + 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.
    DISP i LABEL "Records Processed"
      WITH FRAME rec-info SIDE-LABELS ROW SCREEN-LINES / 2 CENTERED.
    i = i + 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


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