Seeking advice: Functions vs. Messages vs. ?
Posted: Thu Jul 24, 2008 3:12 am
I'm interested in learning the good ways to wrap commonly-used code into a callable routine in Revolution.
[Question #1]
Currently, I define custom message handlers and send a message to the object containing the handler where appropriate. I use custom messages rather than functions since functions must return a value in Revolution, and most of my routines don't return anything. Is this a good solution? I've heard that functions can execute faster than messages after an initial run since they become compiled (the technicalities of this statement might be flawed, as this is just from word-of-mouth, so please correct me or inform me), so think there might be a better way.
[Question #2]
When I use messages and would like to return a value, is it a good idea to place the "return value" into the it variable?
[Question #3]
If I define a function in a stack/card/object script, can I call it from another without a problem?
Any help would be great. I'm trying to improve my Revolution coding practices to "good" rather than "it works". Thanks.
[Question #1]
Currently, I define custom message handlers and send a message to the object containing the handler where appropriate. I use custom messages rather than functions since functions must return a value in Revolution, and most of my routines don't return anything. Is this a good solution? I've heard that functions can execute faster than messages after an initial run since they become compiled (the technicalities of this statement might be flawed, as this is just from word-of-mouth, so please correct me or inform me), so think there might be a better way.
[Question #2]
When I use messages and would like to return a value, is it a good idea to place the "return value" into the it variable?
[Question #3]
If I define a function in a stack/card/object script, can I call it from another without a problem?
Any help would be great. I'm trying to improve my Revolution coding practices to "good" rather than "it works". Thanks.