Results 1 to 4 of 4

Thread: Explicit Function return (RESOLVED)

Threaded View

  1. #1

    Thread Starter
    Hyperactive Member divined's Avatar
    Join Date
    Aug 2004
    Location
    Thessaloniki, Greece
    Posts
    447

    Resolved Explicit Function return (RESOLVED)

    Hello everybody

    I have this very simple question. Suppose the following function :

    Code:
    Function ABC As Boolean
    Do While <condition>
         
         If <condition> Then
           
            <statements> 
            On Error GoTo ErrorHandler
    
            <other_statements>
            ABC = True  ' Correct master password
            Return                      ' Return
         End If
         
         GoTo ShuntErrorHandler
         
    ErrorHandler:
         MsgBox "ERROR!ï", vbCritical
         If Err.Number Then
           Resume ShuntErrorHandler
         End If
    ShuntBadErrorHandler:
         
       Loop
    End Function
    In this code, I just want the function to return a value and give control back to the calling procedure-function. But this does not occur! How do I tell the function to exit. Does the assignment of the function value need to be the last statement of the function?

    thx, in advance

    George Papadopoulos
    Last edited by divined; May 4th, 2005 at 01:28 AM.
    SteadFast!

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