BUG: getpos, ilk, #propList


[ Zettels Traum ] [ search / suche ]

von dp am 27.April 97 um 15:26:55:

From: Daniel Plaenitz
Subject: Lists: getpos, ilk, #propList
To: Multiple recipients of list DIRECT-L

I hit something that may be a quirk, at least I don't understand the logic
behind this behaviour.


set x=23
put getpos([#float,#string,#integer],(the ilk of x))
-- 3

as expected

set x=[23]
put getpos([#float,#string,#integer],(the ilk of x))
-- 0

as expected

set x= [#w1: 90, #w2: 150, #w3: 360]
put getpos([#float,#string,#integer],(the ilk of x))

I get an Script error: Handler not defined on this one.

But:

set x= [#w1: 90, #w2: 150, #w3: 360]
put the ilk of x into c
put getpos([#float,#string,#integer],c)
-- 0

So, it seems I already found a work-around. I just wonder what's happening.

Daniel Plaenitz

It works if ilk is called inline as a function:

set x= [#w1: 90, #w2: 150, #w3: 360]
put getpos([#float,#string,#integer], ilk(x))
-- 0

or

set x= [#w1: 90, #w2: 150, #w3: 360]
put getone([#float,#string,#integer], ilk(x))
-- 0

or

set x= [#w1: 90, #w2: 150, #w3: 360]
put getone([#float,#string,#integer,#proplist], ilk(x))
-- 4

the error returned seems to suggest that when using "the ilk of x" as the
second arg it causes the first arg not to be evaluated as a list. Kinda
looks like a bug.

RJ

From: "John C. Ware"
Subject: Re: Lists: getpos, ilk, #propList
To: Multiple recipients of list DIRECT-L

Yes, its a bug. A cool bug.
In the Director 6 docs, ilk(x) is documented, the ilk of x isn't.
I'd say avoid the ilk of x. Call it as a function.
--jcw (trying to be 'onery and preempt William for once!)

---------
jcw = John C. Ware, Macromedian
for more info, uh, reply...




Dazu:























D. Plänitz