Control Object Properties

Pseudo Objects

 

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 a programmer used to OOP-style programming to deal with the items. Through the use of these pseudo objects, the programmer can access various properties of a file, window or control from other than the currently active window.

Pseudo handles have set values based in the system element they represent. Their 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 the properties of File 15, the Pseudo object would be 1000000015.

To access the properties of Window 2, the value would be 100020000000000.

To access control 234 in window 2, the handle would be 100020023400000.

Note:
The window numbers used in the object handle are always 1 based regardless of the value of the 'B0' system parameter.

See Also

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 file. If window_no zero is given, the current window handle is returned.

'Control(control_no {, window_no } )

Returns a Pseudo object handle for the specified control. If no window number is provided, the current 'active' window will be assumed.

Example:

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