Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Asynchronous Operation question



You cannot pass extra parameters that way.  You can do this:

 widget.system ("blah", function(x) {dosomething(x, "2006");});

jl


> Asynchronous Operation is a double edged sword, on one hand you can
> execute scripts without having to wait for the output, but then
> designing a Asynchronous schema taxes my brain.
> 
> Is it possible to pass variables to the Asynchronous end handler? I am
> attempting to read the contents of a directory, however, if a
> directory exists within the directory I want to read  the contents of
> that.
> 
> I can read the contents of the first directory, no problem, I can then
> read the contents of the second directory no problem, the trouble is
> on the third tier.
> 
> Archive
>      2006
>           01
>           02
>           03
> 
> I can read Archive I get a list that contains "2006", I can then read
> the contents of "2006" and get "01\n02\n\3\n" which I convert to an
> array, but I want to read the contents of each of those dirs, but to
> do that it needs to know that its coming from "Archive/2006". If it
> was synchronous I could just set a temporary variable that stored the
> "2006", but because its Asynchronous I can't.
> 
> Is this possible?
> 
> listsDir = widget.system("/bin/ls " + prefsPath + "/Archive",
> endHandler, "2006");
> 
> Otherwise I'm stumped...
> 
> Any help is greatly appreciated
> 
> thanks
> 
> -js
>  _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Dashboard-dev mailing list      (email@hidden)
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/dashboard-dev/email@hidden
> 
> This email sent to email@hidden

--------------------------------------------------
John Louch         Internet #: email@hidden


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Dashboard-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/dashboard-dev/email@hidden

This email sent to email@hidden

References: 
 >Asynchronous Operation question (From: "Johnny Storm" <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.