Thomas McGrath III <mcgrath3@...> writes: > 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
> My question is "Is the right usage of dispatch?" Not in terms of what you're trying to accomplish. The "handled" result says that there was a handler somewhere in the message path that caught the message and processed it. It's not an indication that the loadxxx command was successful. To do that you'd need to return a value in the result or set a semaphore somewhere or some similar action. You'd be in the same situation if you used "send". Lately I've taken to using send only when I need to send a message in time, and I'm using dispatch for all other situations. There are some subtle differences in context, but otherwise you can treat them the same. And "dispatch function" is a lot easier to read, remember, and maintain than the "value(..." syntax. -- Mark Wieder mwie...@ahsoftware.net _______________________________________________ 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