Calling a function in a specific external stack
Posted: Fri Oct 09, 2009 3:32 pm
Hello All,
This is a little bit of a follow-up to my "malicious code" post. http://forums.runrev.com/phpBB2/viewtopic.php?t=3806
I'm trying to figure out how to call a function in a specific external stack (note the word specific). This is because I would like my two external stacks to use the same function name in order to keep the code generic/consistent.
Example scenario:
Three stacks - MyRevApp.exe, BusinessLayer.rev, DataLayer.rev
In BusinessLayer.rev and DataLayer.rev, I'd like to have a function called StackIsValid(). So, MyRevApp.exe opens the two stacks and I want to call the StackIsValid() function in each. I cannot figure out how to tell Rev which stack to call the function for. I was hoping for something like:
but I can't seem to find a form where that works. The workarounds I have found (and these may be the actual solutions) are:
1) Use a getProp instead of a function (though I'm not sure of any limitations this would result in that are not incurred using a function)
2) Create a handler in the external stacks, use "send" (or "dispatch", though I want an error if the handler doesn't exist and it is my understanding that "dispatch" would eat such an error) to execute the handler in each stack, then check "the result".
Any more good tips from you long-timers?
This is a little bit of a follow-up to my "malicious code" post. http://forums.runrev.com/phpBB2/viewtopic.php?t=3806
I'm trying to figure out how to call a function in a specific external stack (note the word specific). This is because I would like my two external stacks to use the same function name in order to keep the code generic/consistent.
Example scenario:
Three stacks - MyRevApp.exe, BusinessLayer.rev, DataLayer.rev
In BusinessLayer.rev and DataLayer.rev, I'd like to have a function called StackIsValid(). So, MyRevApp.exe opens the two stacks and I want to call the StackIsValid() function in each. I cannot figure out how to tell Rev which stack to call the function for. I was hoping for something like:
Code: Select all
put StackIsValid() of stack "BusinessLayer" into tValid1
put StackIsValid() of stack "DataLayer" into tValid2
1) Use a getProp instead of a function (though I'm not sure of any limitations this would result in that are not incurred using a function)
2) Create a handler in the external stacks, use "send" (or "dispatch", though I want an error if the handler doesn't exist and it is my understanding that "dispatch" would eat such an error) to execute the handler in each stack, then check "the result".
Any more good tips from you long-timers?