TIP: Click on subject to list as thread! ANSI
echo: cis.os9.68000.osk
to: Jim Sutemeier 70673,1754 (X)
from: Bob van der Poel 76510,2203
date: 1992-09-15 22:00:37
subject: #16444-#recursive functions

#: 16450 S12/OS9/68000 (OSK)
    15-Sep-92  22:00:37
Sb: #16444-#recursive functions
Fm: Bob van der Poel 76510,2203
To: Jim Sutemeier 70673,1754 (X)


This might be heresy...but you might consider using a GOTO . I find
goto's very useful to exit a function without a lot of flag checking simply by
putting an EXIT label at the end and then doing a goto EXIT. You might also
consider doing a loop at the top of you function to loop back rather than
calling it recursively (hard to judge that, not knowing what it is you are
doing).

return is fine, but the compiler will give all kinds of warnings if you just do
a return from a function not declared as void (return 0 is fine). And declaring
functions as void has it's own interesting side effects...

There is 1 Reply.

SOURCE: compuserve via textfiles.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.