1 / 7

Function プロシージャの呼び出し

Sub プロシージャ A ( ) : 変数= プロシージャ B ( 引数)     : End Sub. Function プロシージャ B ( 引数 As 型) As  型          : プロシージャ B =処理         : End Function. 1. 2. 3. Function プロシージャの呼び出し. 呼び出し側 呼び出される側. 呼び出し側の引数のカッコについて. 引数有の Sub プロシージャ 引数にカッコを付けない 戻り値を利用する Function プロシージャ 引数にカッコを付ける

mohawk
Download Presentation

Function プロシージャの呼び出し

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Sub プロシージャA ( ) : 変数=プロシージャB(引数)     : End Sub FunctionプロシージャB( 引数 As 型)As 型          : プロシージャB=処理         : End Function 1 2 3 Functionプロシージャの呼び出し 呼び出し側 呼び出される側

  2. 呼び出し側の引数のカッコについて • 引数有のSubプロシージャ引数にカッコを付けない • 戻り値を利用するFunctionプロシージャ引数にカッコを付ける • 戻り値を利用しないFunctionプロシージャ引数にカッコを付けない

  3. ① Private Sub CommandButton1_Click() ② Dim a As Single, b As Single, c As Single ③ a = Val(TextBox1.Text) ④ b = Val(TextBox2.Text) ⑤ c = Add(a, b) ⑥ TextBox3.Text = Str(c) ⑦ End Sub ⑧ Function Add(x As Single, y As Single) As Single ⑨ Add = x + y ⑩ End Function

  4. ① Private Sub CommandButton1_Click() ② Dim a As Single, b As Single, c As Single ③ a = Val(TextBox1.Text) ④ b = Val(TextBox2.Text) ⑤ c = Add(a, b) ⑥ TextBox3.Text = Str(c) ⑦ End Sub ⑧ Function Add(x As Single, y As Single) As Single ⑨ Add = x + y ⑩ End Function

  5. ① Private Sub CommandButton1_Click() ② Dim a As Single, b As Single, c As Single ③ a = Val(TextBox1.Text) ④ b = Val(TextBox2.Text) ⑤ c = Add(a, b) ⑥ TextBox3.Text = Str(c) ⑦ End Sub ⑧ Function Add(x As Single, y As Single) As Single ⑨ Add = x + y ⑩ End Function

  6. ① Private Sub CommandButton1_Click() ② Dim a As Single, b As Single, c As Single ③ a = Val(TextBox1.Text) ④ b = Val(TextBox2.Text) ⑤ c = Add(a, b) ⑥ TextBox3.Text = Str(c) ⑦ End Sub ⑧ Function Add(x As Single, y As Single) As Single ⑨ Add = x + y ⑩ End Function

  7. ① Private Sub CommandButton1_Click() ② Dim a As Single, b As Single, c As Single ③ a = Val(TextBox1.Text) ④ b = Val(TextBox2.Text) ⑤ c = Add(a, b) ⑥ TextBox3.Text = Str(c) ⑦ End Sub ⑧ Function Add(x As Single, y As Single) As Single ⑨ Add = x + y ⑩ End Function

More Related