Goto...Return question

M

mousetrap

Hi,

Here's part of my code:

Function doProcess(input as string) as integer
'(...code here)
Goto CleanUp
'(...code here)
Exit Function
CleanUp:
'(...code here)
if flag = true then
Return 'here I need to resume the
'function after the "Goto CleanUp" line
end if
'(...code here)
End Function

Here's the problem:
The "Return" line doesn't work. What do I need to write instead?
I'm using Goto because that part of the code is used many many times in
that function and I cannot rewrite it as another function.

Thanks

MouseTrap
 
M

mousetrap

mudraker said:
Change Goto Cleanup to GoSub Cleanup

I thought that GoSub worked only in a Sub and not in a function.
However, I tried it and it worked. Thanks.
 
Top