functions: use a controls name as a parameter

Klaus Major klaus at major-k.de
Sat Jul 24 11:44:55 EDT 2004


Hi Malte,

> Hi list,
>
> maybe you can help me with the following:
> I want a function with 2 parameters. Each one the name of a control.
>
> Like this
>
> function test theObject1,theObject2
>   return the width of theObject1,the height of theObject2
> end test
>
> This will work if the names of the controls are quoted:
> test("grc myGrc","img myImg")
>
> what I want is a syntax like
> test(grc "myGrc",img "myImg")
>
> just like intersect does e.g intersect(grc "myGrc",img "myImg") as 
> quoting
> the whole name doesn´t seem natural to me and I think it wouldn´t be 
> good
> style.
> Any hints?

If you are looking for a natural way and good style then take "the long 
id of xxx",
which lets you use the regular names in quotes AND looks very PRO :-D

...
put test(the long id of fld "eins", the long id of img "drei")
...

Hope das hilft :-)

> Malte

Ciao ragazzo

Klaus Major
klaus at major-k.de
http://www.major-k.de



More information about the use-livecode mailing list