Progress
Programming
Handbook


Handle Management

In general, handles allow you to pass around references to widget, procedure, server, ActiveX, and system objects both within procedures (using variables) and between procedures (using parameters). Depending on the object and what you do with it, a handle might or might not be valid at different points in your application. To ensure that the handle you reference is valid, you can test it using the VALID–HANDLE function. This function returns TRUE if the specified handle points to a valid object that is still available to your application.

Progress also reuses handle values. For example, if you delete a dynamic button, Progress might reuse the widget handle for the deleted button to point to another widget, procedure, or system object. To ensure that a valid handle you have stored still points to a widget of a particular type, you can check the value of the TYPE attribute for the handle. For example, if the handle points to a window, the TYPE attribute is set to “WINDOW”. For more information on referencing attributes, see the "Widget Methods" section.

There are occasions where you might want to store a handle value as a string. Thus, you can convert any widget handle value to an integer string using the STRING function. To convert this string to its original handle value, use the WIDGET–HANDLE function. This function converts handle values for all types of handles. (Progress automatically converts values between component handles and any other data type.) For more information on the WIDGET–HANDLE function, see the Progress Language Reference .

CAUTION: The WIDGET–HANDLE function can only convert a string to a handle value that was originally converted from a handle value. Any other string causes a system error.

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