midrange.com code scratchpad |
Name:
Anonymous
|
Scriptlanguage:
Plain Text
|
Tabwidth:
4
|
Date:
03/02/2010 08:46:29 pm
|
IP:
Logged
|
|
Description:
The user was to lazy to give a description
|
Code:
- /Free
-
- P myProc B
- D PI 10I 0
- D parm1 8 Const
-
- D once S 3U 0
- D rtnValue S Like(myProc)
-
- /Free
-
- // This approach doesn't add unnecessary condition tests
- // to the flow - that is as clean as any alternative. It
- // also adheres to the "one entry / one exit" standard of
- // programming.
-
- rtnValue = -9999 ;
- For once = 1 to 1 ;
- // Stuff
- // Oops - an error is found. We gotta get out.
- If oops ;
- // do stuff
- rtnValue = -1 ;
- exsr return;
- EndIF ;
- // More stuff
- // More stuff
- If oopsToo ;
- // do stuff
- rtnValue = -2 ;
- exsr return;
- EndIF ;
- rtnValue = *Zero ;
- EndDO ;
- exsr return;
-
- begsr return;
- // Cleanup
- Return rtnvalue;
- endsr;
-
- /End-free
-
- P myProc B
-
|
|
|