Lingo Dictionary > G-K > ilk() |
![]() ![]() ![]() |
ilk()
Syntax
ilk(
object
)
ilk(
object
,
type
)
Description
Function; indicates the type of an object.
![]() |
The syntax |
![]() |
The syntax |
The following table shows the return value for each type of object recognized by ilk()
:
Type of Object |
ilk(Object) returns |
ilk(Object, Type) returns 1 only if Type = |
Example |
---|---|---|---|
linear list |
|
|
|
property list |
|
|
|
integer |
|
|
|
float |
|
|
|
string |
|
|
|
rect |
|
|
|
point |
|
|
|
color |
|
|
|
date |
|
|
|
symbol |
|
|
|
void |
|
|
|
picture |
|
|
|
parent script instance |
|
|
|
xtra instance |
|
|
|
member |
|
|
|
xtra |
|
|
|
script |
|
|
|
castlib |
|
|
|
sprite |
|
|
|
sound |
|
|
|
window |
|
|
|
media |
|
|
|
Example
The following ilk
statement identifies the type of the object named Bids.
Bids = [:] put ilk( Bids ) -- #proplist
Example
The following ilk
statement tests whether the variable Total is a list and displays the result in the Message window:
Total = 2+2 put ilk( Total, #list ) -- 0
In this case, since the variable Total is not a list, the Message window displays 0, which is the numeric equivalent of FALSE.
Example
The following example tests a variable named myVariable and verifies that it is a date object before displaying it in the Message window:
myVariable = the systemDate
if ilk(myVariable, #date) then put myVariable
-- date( 1999, 2, 19 )
![]() ![]() ![]() |