Using groups as custom dialogs: a solution for Mac, PC and iOS
Ken Ray
kray at sonsothunder.com
Sat Jul 9 12:08:11 EDT 2011
That's because "the params" includes the original function call as well... try:
if the paramcount = 0 then
send "initMe" to tObj
else
get matchText(the params,".*?\((.*?)\)",tParams)
send "initMe" && tParams to tObj
end if
That should work...
On Jul 9, 2011, at 9:57 AM, Chipp Walters wrote:
> Hmmm. Not sure that works. Create a button with script:
>
> *on* mouseUp
>
> *get* test("param 1","param 2")
>
> *put* it
>
> *end* mouseUp
>
>
> *function* test
>
> *return* word 2 to -1 of the params
>
> *end* test
>
>
> returns:
>
> 1","param 2")
>
>
> On Sat, Jul 9, 2011 at 3:59 AM, Dick Kriesel <dick.kriesel at mail.com> wrote:
>
>> On Jul 9, 2011, at 1:20 AM, Chipp Walters wrote:
>>
>>> Here's one for you, Dick..
>>> In the above mentioned stack there's this part of a script, which is used
>> to
>>> pass the function params onto a handler:
>>>
>>> *if* the paramcount = 0 *then*
>>>
>>> *send* "initMe" to tObj
>>>
>>> *else*
>>>
>>> *repeat* with x=1 to the paramcount
>>>
>>> *put* "param(" &x& ")," after tParams
>>>
>>> *end* *repeat*
>>>
>>> *delete* last char of tParams
>>>
>>> *put* "send " "e&"initMe " & tParams "e& " to tObj" into tDo
>>>
>>> *do* tDo
>>>
>>> *end* *if*
>>>
>>> *
>>> *
>>>
>>> *Is there a way to do this without having to 'do' the script?*
>>
>> AFAICT, that all boils down to the following:
>>
>> send "initMe" && word 2 to -1 of the params to tObj
>>
>> Agree?
>>
>> But note that both of these ways fail if any parameter is an array.
>>
>> -- Dick
>>
>>
>> _______________________________________________
>> 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
>>
>
>
>
> --
> Chipp Walters
> CEO, Shafer Walters Group, Inc.
> _______________________________________________
> 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
Ken Ray
Sons of Thunder Software, Inc.
Email: kray at sonsothunder.com
Web Site: http://www.sonsothunder.com/
More information about the use-livecode
mailing list