Results 1 to 7 of 7

Thread: Getting out

Threaded View

  1. #1

    Thread Starter
    PowerPoster MMock's Avatar
    Join Date
    Apr 2007
    Location
    My Mustang GT
    Posts
    4,566

    Getting out

    Is this a good way of getting out of a function?

    Code:
                    If f1.AppendLine(strTextMsg, strText) = True Then
                        Return True
                        Exit Function
                    Else
                        Return False
                        Exit Function
                    End If
    This is in code that I'm taking over and finishing and I'm just wondering if I should be skeptical of this logic. The programmer seemed to overly-use "Exit Function" (like right before an exception handler would be called as if he thought if he didn't have it he'd fall right through into the exception handler even when there was no exception).

    Personally, I would've just coded: Return(f1.AppendLine(strTextMsg, strText))

    Thanks.
    Last edited by MMock; Jun 28th, 2010 at 07:11 AM. Reason: Thought I hit preview post...
    There are 10 kinds of people in this world. Those who understand binary, and those who don't.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width