exists

Typefunction
DictionaryLCS
LibraryLiveCode Script
Syntax
exists(<object>)
Synonymsexistence
Summary

Returns true if the specified object exists, false if it does not.

Introduced1.0
OSmac, windows, linux, ios, android
Platformsdesktop, server, mobile
Parameters
NameTypeDescription
object

Any object reference.

Example
exists(card field 1)
exists(button "OK" of card "Preferences")
Values
NameTypeDescription
return

The exists function returns true or false.

RelatedProperty: owner
Operator: there is a, there is no
Keyword: file
Object: image
Function: isNumber
Glossary: folder, current card, return, process, object
Control Structure: function
Description

Use the exists function to make sure an object exists before you try to perform an action on it, or to determine whether to create an object.

To find out whether any of a certain type of object exist, use the exists function with the number 1. For example, exists(image 1) returns true if there are any images on the current card, and false otherwise.

You can also specify a chunk of a container, but in this case the exists function always returns true.

Tip: To find out whether a file or folder exists, or whether a process is running, use the there is a operator.

Tagsobjects