after searching a problem in an actual program for hours, I think that it maybe would be helpful, if a Procedure for example is declared with a return parameter long like
Pb returns 0 by default, for every procedure. When you declare it with something other than Int--because you require a return value-- getting that default value can be a tricky thing to chase down.
The smart thing to do, if you require a valid return value, is to, well, just do it, but if you want to make it easy to see if you skipped it, then put and invalid value (error code) at the bottom. Then, check it for the error code on the receiving end.
+1. I agree with hoerbie. If you're defining a type with the Procedure command, then you're obviously intending to use ProcedureReturn with it, so if the compiler gets to the end of the procedure and hasn't seen one, it could raise an error to alert you. This has happened to me before where I had ProcedureReturn commented out during a test, and forgot to uncomment it again.
Tenaja wrote: Sat Apr 09, 2022 10:18 pm
Pb returns 0 by default, for every procedure. When you declare it with something other than Int--because you require a return value-- getting that default value can be a tricky thing to chase down.
That not exact. ProcedureReturen without variable return the eax/rax register