Pseudo Objects
Introduction to Pseudo Objects  
  Prior Next
  Pseudo objects provide a means to access files, windows, and all controls directly as objects. Using pseudo object handles provide a more consistent way to access attributes of system elements and can make it easier for programmers, familiar with OOP style programming. Through the use of these pseudo objects, programmers can access various properties of a file, window or control from other than the currently active window.

Pseudo objects are a +PxPlus Exclusive (v10)

Pseudo handles have set values based in the system element they represent. The value is based on the following algorithm(s):

For File Pseudo Objects The object handle will be 1,000,000,000 + file number.
For Window Objects The object handle will be 1,000,000,000 + window number * 100,000.
For Control Objects The object handle will be 1,000,000,000 + window number * 100,000 + the control id.
   
Examples:

To access properties of file 15 the pseudo object would be 1000000015.
To access properties of window 2 the value would be 1000200000.
To access control 234 in window 2 the handle would be 1000200234.



*Note* The window numbers used in the object handle are always 1 based regardless of the value of the 'B0' System Parameter.


  For information on accessing each types of pseudo objects please see:

- Using file handles
-
Using window handles
-
Using control handles

Generating Pseudo Handles

The system object *SYSTEM provides three methods to generate pseudo object handles.

Method call

Description

'File( file_no ) Returns a pseudo object handle for the specified file.
'Window( window_no ) Returns a pseudo object handle for the specified window. If window_no zero is given, the current window handle is returned.
'Control( {window_no, }control_no) Returns a pseudo object handle for the specified control. If no window number is provided, the current 'active' window will be assumed.

For Example:

0010 Sysobj = NEW("*SYSTEM")
0020 FileHdl = SysObj'File(5) ! This will yield a pseudo handle to the file open on channel 5

  Prior Next