Condtional parameters in handler calls

J. Landman Gay jacque at hyperactivesw.com
Tue Jul 17 21:52:25 EDT 2012


On 7/17/12 7:54 PM, Peter Haworth wrote:
> Thanks everyone for the alternative ways of doing this.  I think Mike's
> comes closest to what I was hoping for.  It was pretty much an academic
> question. I still think it would be nice to be able to do it though.

Not exactly what you're looking for, but I never miss an opportunity to 
post this lovely thing:

return (item offset(char 1 of (<condition>),"tf") of quote & result1 
&","& result2 & quote)

derived from a handler by Tony Root, HC team.

On Tue, Jul 17, 2012 at 4:35 PM, Mike Bonner <bonnmike at gmail.com> wrote:

 > How about something like this?
 >
 > command myCommand parm1,parm2,parm3
 >    put parm1 && parm2 && parm3
 > end myCommand
 >
 > function myFunc parm1,parm2,pConditional
 >    if value(pConditional) then
 >       return parm1
 >    else
 >       return parm2
 >    end if
 > end myFunc
 >
 > on mouseup
 >    myCommand 14,myFunc(3,22,"parm1 < parm2"),35
 > end mouseup

-- 
Jacqueline Landman Gay         |     jacque at hyperactivesw.com
HyperActive Software           |     http://www.hyperactivesw.com






More information about the use-livecode mailing list