I would guess that it's a matter of preference but I never like to RETURN in the middle of a function. I think keeping this philosophy forces modularity and keeps my functions small which hopefully increases their re-use. With smaller (shorter) functions, it also keeps the indentation to a minimum. Yes, I do end up with many more methods/functions though.

The way you combined the commands, you've already decreased the number of indentations compared to the way that I wrote it out, which is a plus. Dominic's CASE .. ENDCASE decreases the indentation levels as well.

Thanks.

Kevin Cully
CULLY Technologies, LLC

Sponsor of Fox Forward 2006!
http://foxforward.net


Mike yearwood wrote:
Personally I find it easiest to check parameters first and get out if
necessary and then follow with the heart of the function. This clearly
separates the two steps and the meat of the function is cleaner and
easier to follow.

FUNCTION MyFunction(tcSomething AS String) AS String
  LOCAL lcRetVal
  lcRetVal = []
  IF PCOUNT() = 0 OR VARTYPE(tcSomething) # "C"
    RETURN lcRetVal
  ENDIF

*Now the real meat of the function is not tabbed way over for nothing.

RETURN lcRetVal
ENDFUNC



_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to