Condtional parameters in handler calls

Dick Kriesel dick.kriesel at mail.com
Tue Jul 17 19:32:22 EDT 2012


Hi, Pete.  You can wrap your "if" in a function, so any caller can have just one line.

myCommand parm1,iff(<condition>,<parm2a>,<parm2b>),parm3

function iff pBoolean,pTrueValue,pFalseValue
   if pBoolean then
      return pTrueValue
   else
      return pFalseValue
   end if
end iff

-- Dick


On Jul 17, 2012, at 4:18 PM, Peter Haworth wrote:

> I'm pretty sure this is not possible but it would be very cool if a
> parameter to a command could be a conditiion something like:
> 
> myCommand parm1,if <condition> then <parm2a> else <parm2b>,parm3
> 
> I've tried every which way to do that but always get compile errors.
> 
> Not possible, right?
> 
> Pete
> lcSQL Software <http://www.lcsql.com>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode





More information about the use-livecode mailing list