René Nyffenegger's collection of things on the web
René Nyffenegger on Oracle - Most wanted - Feedback -
 

function [VBA]

option explicit

public sub function_test


  if func_1() then
     msgBox "func_1 return true"
  else
     msgBox "func_1 return true"
  end if

  if func_2() then
     msgBox "func_2 return true"
  else
     msgBox "func_2 return true"
  end if

end sub


private function func_1() as boolean

 ' Not allowed in VBA:
 '
 ' return true

  func_1 = true

end function


private function func_2() as boolean

  if 42 > 10 then

     if 1 > 0 then
        
        func_2 = true
        exit function
     end if

  end if
  
  func_2 = false

end function
See also other VBA stuff