1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
| Private Sub Command1_Click()
Dim a As String
a = "toto"
procedure1 a
MsgBox a
procedure2 a
MsgBox a
MsgBox fonction1(a)
MsgBox fonction2(a)
End Sub
Private Sub procedure1(a As String)
a = "hola"
Label1.Caption = "SALUT"
End Sub
Private Sub procedure2(titi As String)
titi = "bonjour"
End Sub
Private Function fonction1(machin As String) As String
fonction1 = Left(machin, 4)
End Function
Private Function fonction2(truc As String) As Integer
If Trim(truc) = "bonj" Then
fonction2 = 2
Else
fonction2 = 24
End If
End Function |