Default values for handler parameters

Mark Wieder mwieder at
Sat Dec 7 21:32:24 EST 2013


Saturday, December 7, 2013, 4:43:32 PM, you wrote:

> Live code allows:

> local tVar="abc"

> but it doesn't seem to allow:

> command myCommand p1,p2="abc"

> .. unless there's some other syntax for it.

> Seems like an omission?

Yeah. I'd love to have default parameters someday.
Meanwhile I work around it by

command myCommand p1, p2
  if p2 is empty then
    put "abc" into p2
  end if
  ... carry on
end myCommand

-Mark Wieder
 ahsoftware at

More information about the Use-livecode mailing list