Please enable JavaScript to view this site.

ESL Documentation

Object Inquiry Built-in Function

Return whether a specified object exists.

exists OBJECT_NAME

OBJECT_NAME

The identifier for an object.

Description

The value returned is the boolean value (true or false) associated with the existence of the specified object. If the specified object currently exists (it has been defined, and has not been deleted), true is returned; otherwise, false is returned.

If you have more than one object with the same name, be sure to specify ancestry with the exists function (see the first example following).

Example

 

response to Read_MC

 if (exists News_TR in WindowA_GR) then

         ...

 end if

 

# The following example shows how to dynamically create

# an object only when needed:

 

response to DisplayReport_PB

 if (exists ReportRegion_TR) then

         # Just make it visible if it is there already.

         make ReportRegion_TR visible

 else

         # Create it from scratch the first time.

         add visible enabled textual region ReportRegion_TR

                 window size 80 columns 20 lines

                 at 0 50

         read file "monthly.rpt" into ReportRegion_TR

 end if