Strange function bug

Dar Scott dsc at swcp.com
Fri Nov 17 20:10:42 EST 2006


On Nov 17, 2006, at 5:22 PM, Matt wrote:

> I was recently creating a stack when I noticed that one of my  
> functions
> wouldn't work right. After some further investigation, i realized  
> that the
> function was not getting the second param that I was passing it.  
> So, just
> for fun, I swapped the two params in the function and in the  
> script, and now
> the other variable always turned up empty. If anyone could shed  
> light on
> this problem i would appreciate it.

Try this as the first line of the function to see if the problem is  
that the parameter is empty or the number of parameters is wrong:

     put the paramCount

I would guess a problem in spelling, either in the function or in its  
test.

If the parameter is an array directly returned by another function,  
you have run across an old bug (3411).  You will have to split up the  
expression.  If the parameter is an array returned by the object  
version of value(), then the value is lost by value() (bug 699).  If  
the parameter is 'the result' after a send (not in time), then the  
array is lost then, too.

Someone on the list recently had a problem with a function and later  
realized he had also defined it another place.

Dar Scott

***************
Underlying most arguments against the free market
is a lack of belief in freedom itself.
                 -- Milton Friedman (1912-2006)






More information about the Use-livecode mailing list