I am trying to figure out the 'correct' use of dispatch:

I first set up a lot of details in an iOS app on launch. I load some text files 
and populate some custom props for use throughout the app. After that I want to 
load the appropriate fields and other aspects of the app from those custom 
props BUT only if everything else loaded. I won't know what the data is so I 
can't check that, I can only tell wether or not something was loaded. I was 
trying to determine if I should use send or dispatch.

I am using this code now:

on openstack
loadCustomPropsFromFile
dispatch "loadAllUsers" to card "Users" of this stack
     if it is "handled" then
          dispatch "loadCurrentUser" to card "Users" of this stack
          if it is "handled" then
               dispatch "loadCurrentUserForm" to card "Users" of this stack
          end if
     end if
end openstack

But I could use:

send "loadAllUsers" to card "Users" of this stack
send "loadCurrentUser" to card "Users" of this stack
send "loadCurrentUserForm" to card "Users" of this stack


My question is "Is the right usage of dispatch?" 
"Is there another 'better' way to accomplish this?"

Thanks

Tom

-- Tom McGrath III
http://lazyriver.on-rev.com
mcgra...@mac.com

_______________________________________________
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Reply via email to