Help with using the result value returned from a method
DRMorrison
Posts: 81
Hi there,
I'm trying to figure out how to use the result in the calling method that is returned from the called method--hope that's clear.
This should help. This is an example only, but is representative of my code--can't get to it right now.
How do I check the result returned from the Start_Something method in the Main method?
I was able to find out how to set the result to be returned in the manual, but not how to use it once returned.
Thank you, Daniel
I'm trying to figure out how to use the result in the calling method that is returned from the called method--hope that's clear.
This should help. This is an example only, but is representative of my code--can't get to it right now.
PUB Main Start_Something <do some other things> PUB Start_Something : Fail <check some pins> if SomePin == 0 <things are good here> else Fail := 1
How do I check the result returned from the Start_Something method in the Main method?
I was able to find out how to set the result to be returned in the manual, but not how to use it once returned.
Thank you, Daniel
Comments
Yes, <do some other things> will be executed, along with many other lines following that statement.
I'm looking for a way to determine in the Main method whether or not there was success in the
Start_Something method. I suppose that I could have used a global variable, but why not use
the return value, since it's there.
And just for clarification, would this also work?
Daniel