Call-By-Value & Call-By-Reference

Nur ein ganz kurzes Beispiel, um zu zeigen, wie ein Call-By-Value & Call-By-Reference aufgebaut ist.

Private Sub btByRef_Click()
    tbAusgabe.Text = TestByRef(tbEingabe.Text)
End Sub
 
Private Sub btByVal_Click()
    tbAusgabe.Text = TestByVal(tbEingabe.Text)
End Sub
 
Public Function TestByRef(ByRef zahl As Integer) As Integer
    zahl = zahl + 1
End Function
 
Public Function TestByVal(ByVal zahl As Integer) As Integer
    zahl = zahl + 1
    Return zahl
End Function
Dienstag, Mai 6th, 2008 at 00:02
No comments yet.

Hinterlass einen Kommentar

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="">