i have this arrval(1) to arrval(6) and i want to pas the values to asub procedure.how will the call statement be like?ie
call namepro(.....)
and the sub name?ie
private sub manepro(........)
Printable View
i have this arrval(1) to arrval(6) and i want to pas the values to asub procedure.how will the call statement be like?ie
call namepro(.....)
and the sub name?ie
private sub manepro(........)
VB Code:
Option Explicit Option Base 1 Private Sub Form_Load() Dim arrval(6) As String arrval(1) = "one" arrval(2) = "two" arrval(3) = "three" arrval(4) = "four" arrval(5) = "five" arrval(6) = "six" PrintArr arrval End Sub Private Sub PrintArr(arr() As String) Dim i As Integer For i = 1 To UBound(arr) Debug.Print arr(i) Next i End Sub
The call will be:
- or -VB Code:
namepro arrval(1), arrval(6)
VB Code:
Call namepro(arrval(1), arrval(6))
The look of the sub itself depends on the datatype of the array (String, Integer, etc.). Assuming it is string, the sub would look something like this:
VB Code:
Private Sub namepro(strArg1 As String, strArg2 As String)