Abort (able) method with a return value in SPIN
mcstar
Posts: 144
Is it possible to return a result value from a method that has been called with an abort trap?
IOW,
I have code like ...
·if NOT \recbyte
·· <code to display error etc>
where recbyte is a method that·can return a byte,· but it can also abort with a false... is it possible to get the result byte from recbyte into a variable under normal conditions,·but also have code like this handle the error condition?· What would be the syntax for this?
Would something like this work
·if NOT b := \recbyte
where b is a local variable?
IOW,
I have code like ...
·if NOT \recbyte
·· <code to display error etc>
where recbyte is a method that·can return a byte,· but it can also abort with a false... is it possible to get the result byte from recbyte into a variable under normal conditions,·but also have code like this handle the error condition?· What would be the syntax for this?
Would something like this work
·if NOT b := \recbyte
where b is a local variable?
Comments
the fsrw stuff for SD support) I picked negative values as "out of range". So:
Note I fixed a typo in the above code.
Post Edited (rokicki) : 7/3/2007 11:25:00 PM GMT