Posted: Sun Sep 01, 2002 10:13 pm
Restored from previous forum. Originally posted by Pupil.
It's perfectly legal to have several ProcedureReturn statements
in a procedure, but you have to separate them with condition code
(i.e. If, Else, ElseIf ...) and everything you want done before
returning from the procedure must be done before the ProcedureReturn
is executed. It's possible, if wanted or needed, to have only one
ProcedureReturn in the end of the procedure like in the code below,
by storing the return data in a temporary variable(like you said in
your post). Sometimes it's best to have only one procedurereturn statement
and other times you get much cleaner code by having serveral, it's all up
to you to choose what suits you best...
Just to get everything straight.Originally posted by merendo
@Pupil: OK!!! Thanks, I guess I have to say: procedurereturn result$ and only change the vari result$![]()
It's perfectly legal to have several ProcedureReturn statements
in a procedure, but you have to separate them with condition code
(i.e. If, Else, ElseIf ...) and everything you want done before
returning from the procedure must be done before the ProcedureReturn
is executed. It's possible, if wanted or needed, to have only one
ProcedureReturn in the end of the procedure like in the code below,
by storing the return data in a temporary variable(like you said in
your post). Sometimes it's best to have only one procedurereturn statement
and other times you get much cleaner code by having serveral, it's all up
to you to choose what suits you best...
Code: Select all
Procedure.s TestProc(foo.l)
if foo > 10 and foo 100 and foo ""
result$ = "The number given to this procedure was " + result$
else
result$ = "The number provided isn't in a predefined span"
endif
ProcedureReturn result$
EndProcedure