hi all,
i am a little confused abt function and a public sub .please take a look at the below examples.
vb Code:
  1. Private Sub Command_Click()
  2.   Call intO(5, 6)
  3.   Debug.Print intO
  4. End Sub
  5.  
  6. Public Function intO(intL As Integer, intX As Integer) As Integer
  7.     intO = intL + intX
  8.     Exit Function
  9. End Function
here i get an error on debug.print intO although this can be over come by adding these lines
vb Code:
  1. Private Sub Command_Click()
  2. dim intOut as integer
  3.  intOut = Call intO(5, 6)
  4.   Debug.Print intOut
  5. End Sub
my question is i am trying to return the value from the public function . but i get errors.. i tried to use the return statement but still i get errors. although i have publicly declared intO as an integer then why do i have to assign it to a variable again?