|
|
 |
'Here is two different ways to use procedures...
'General
Dim mySum1 As Integer
Dim mySum2 As Integer
Dim X As Integer
'Part I''''''''''''''''''''''''''''''
'uses a procedure without in parameter
Private Sub myProc1()
mySum1 = X + 5 'add X with 5 and set answer in mySum1
End Sub
Private Sub Command1_Click()
X = 5 'set X = 5
Call myProc1 'then call our procedure myProc1
Text1.Text = mySum1 'write mySum1
End Sub
'END Part I''''''''''''''''''''''''''
'Part II'''''''''''''''''''''''''''''
'uses a procedure with in parameter
Private Sub myProc2(Y As Integer)
mySum2 = Y + 5
End Sub
Private Sub Command2_Click()
Call myProc2(5) 'call our procedure myProc2 with inparameter 5
Text2.Text = mySum2 'write mySum2
End Sub
'END Part II'''''''''''''''''''''''''
|
 |
Visual Basic Source Code |
I hope you found this Visual Basic tutorial useful!
Don't forget to mention Apron Tutorials in your References!
Best Regards
Ronny André Reierstad
|
|
|