Passing Lists II
Sarah
sarahr at genesearch.com.au
Sun Jan 19 17:59:01 EST 2003
This seems to be working as I would expect. A comma is used as a
parameter delimiter when calling a handler or function, so you are
sending your sub-handler 7 parameters and only dealing with the first
in your script.
Here is what I would use:
on setTime theTime
if the paramCount > 1 then
repeat with i = 2 to the paramCount
put comma & param(i) after theTime
end repeat
end if
answer "setTime time is" && theTime
end setTime
Alternatively, you could replace the commas with something else before
sending and put them back after sending.
Cheers,
Sarah
On Monday, January 20, 2003, at 07:36 am, Rob Cozens wrote:
> Hi All,
>
> Put these handlers in a button, enter a time in dateItems (eg:
> 2003,1,19,9,26,0,0) and see what you get.
>
> on mouseUp
> ask "Enter the time in a format that converts to dateItems."
> if it is empty then exit mouseUp
> put it into theTime
> answer "The time is"&&theTime
> send "setTime"&&theTime to me in 20 milliseconds
> end mouseUp
>
> on setTime theTime
> answer "setTime time is"&&theTime
> end setTime
>
>
> When I run this in v1.5A7, mouseUp says theTime is 2003,1,19,9,26,0,0;
> but setTime says theTime is 2003. I worked around the problem by
> converting theTime to seconds before passing it...but (a) I shouldn't
> have to, and (b) I am concerned about the broader implications of
> sending any list that is input via an ask dialog (or in general?).
>
> Rob Cozens
> CCW, Serendipity Software Company
> http://www.oenolog.com/who.htm
>
> "And I, which was two fooles, do so grow three;
> Who are a little wise, the best fooles bee."
>
> from "The Triple Foole" by John Donne (1572-1631)
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> http://lists.runrev.com/mailman/listinfo/use-revolution
>
More information about the use-livecode
mailing list