Progress
Language Reference


CAN-QUERY Function

Interfaces
OS
SpeedScript
All
All
Yes

Returns a logical value indicating whether you can query a specified attribute or method for a specified widget.

SYNTAX

CAN-QUERY ( widget-handle , attribute-name ) 

widget-handle

An expression that evaluates to a widget handle. The handle must refer to a valid widget.

attribute-name

An expression that evaluates to a character-string value. The contents of the string must be an attribute or method name. For more information on attributes, see the Attributes and Methods Reference.

EXAMPLE

The following example prompts for a widget type and an attribute. It creates a widget of the specified type and passes a handle to that widget and the attribute you specified to the CAN-QUERY and CAN-SET functions. Then it reports whether the attribute can be queried or set for that widget.

r-prog.p
DEFINE VARIABLE attribute AS CHARACTER FORMAT "x(24)" LABEL "Attribute".
DEFINE VARIABLE queryable AS LOGICAL VIEW-AS TOGGLE-BOX LABEL "Query".
DEFINE VARIABLE setable   AS LOGICAL VIEW-AS TOGGLE-BOX LABEL "Set".
DEFINE VARIABLE temp-handle AS WIDGET-HANDLE.
DEFINE VARIABLE widget-type AS CHARACTER FORMAT "x(24)" LABEL "Widget".

FORM
   widget-type attribute setable queryable.

REPEAT:
   UPDATE widget-type attribute.

   CREATE VALUE(widget-type) temp-handle.

   queryable = CAN-QUERY(temp-handle, attribute).
   setable = CAN-SET(temp-handle, attribute).
   
   DISPLAY queryable setable.
   
   DELETE WIDGET temp-handle.
END. 

NOTE

SpeedScript — Use with buffer-field, buffer-object, and buffer, and query-object handles.

SEE ALSO

CAN-SET Function, LIST-QUERY-ATTRS Function, LIST-SET-ATTRS Function


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