ObjectP

From Director Online Wiki
Jump to: navigation, search

objectP is one of the predicate functions in Lingo. objectP returns either true or false depending on whether the variable in question is a complex variable type such as an object created from a parent script, and Xtra or a Window. In addition objectP will return true if pass a list or property list.

Example

testScript = new (script"foo")
put objectP(testScript)
-- 1

testList = [1,2,3,4,5]
put objectP(testList)
-- 1

As such it is usually much safer to use the ilk function to determine the exact type of a variable.

What is an object?

All the following are considered to be objects:

  • scripts
  • instances of scripts
  • property and linear lists
  • points and rects
  • members
  • sprites
  • vectors
  • colors

These data types all have properties, and are passed by reference rather than by value.

See also:

ilk