What is the difference between Sub and Function in VB6?

前端 未结 8 1946
孤城傲影
孤城傲影 2020-12-25 09:57

I am going through some old VB code and I run into function definitions like these -

 Private Function ExistingCustomer(Index As Integer, Customer As String)         


        
8条回答
  •  伪装坚强ぢ
    2020-12-25 10:22

    function in vb

    • a function must return some value/s
    • Syntax : private function fun_name(argument/s(optional)) as return_type(integer,string..) return value end function
    • fun_name(arguments(optional) ) is enough for function call

    sub in vb

    • a sub need not to be return any value/s
    • Syntax : private sub sub_name(argument/s(optional))

      end sub

    • sub_name(arguments(optional) ) is enough for function call

提交回复
热议问题