Presentation is loading. Please wait.

Presentation is loading. Please wait.

Sub 範例 Sub F ( X ) MsgBox(X ^ 2 ) End Function

Similar presentations


Presentation on theme: "Sub 範例 Sub F ( X ) MsgBox(X ^ 2 ) End Function"— Presentation transcript:

1 Sub 範例 Sub F ( X ) MsgBox(X ^ 2 ) End Function
Private Sub Form_ Activate() Call F(3) End Sub

2 Function 範例 Function F ( X ) F = X ^ 2 End Function
Private Sub Form_ Activate() MsgBox( F (2) ) End Sub

3 Function 範例 (比較級) Function F ( X , Y ) F = X ^ 2 + Y End Function
Private Sub Form_ Activate() Dim A, B As Short A = 1 : B = 2 MsgBox( F ( A, F (A , B) ) ) End Sub

4 Function 範例 (最高級) Function F ( X , Y ) F = X ^ 2 + Y End Function
Function G ( X , Y ) F = Y ^ 2 Private Sub Form_ Activate() Dim A, B As Short A = 1 : B = 2 MsgBox( G(A,F ( A, B ) )) End Sub


Download ppt "Sub 範例 Sub F ( X ) MsgBox(X ^ 2 ) End Function"

Similar presentations


Ads by Google