0

Hi all,

Could anyone please check my sample code because I can't see the final result?

Private Sub Form1_Load()
Call AnyNumberArguments
Call AnyNumberArguments(1)
Call AnyNumberArguments(2, 3)
Call AnyNumberArguments(4, 5, 6)
Call AnyNumberArguments(7, 8, 9, 10, 11, 12)
End Sub


Private Sub AnyNumberArguments(ParamArray x() As Variant)
Dim y As Integer

Print "Procedure AnyNumberArguments received:"
For y = LBound(x) To UBound(x)
Print x(y) & Space$(4);
Next y

Print

End Sub

Best Regards,

Octavia

2
Contributors
3
Replies
4
Views
9 Years
Discussion Span
Last Post by choudhuryshouvi
0

call the function from some other event expect form_load.

try it inside of a command button click event.

it will work.

regards
Shouvik

0

Hi choudhuryshouv,

I had already tested that method before. I could see the result.
I also used 'Debug.Print' to do the testing. These two methods can see the result, but I really don't know why we can print out while starting 'Form_Load'.

Thanks,
Octavia

0

make the last print command inside ur function body commented.

and one more thing, i have already tried your code in my system, it worked smoothly and displayed the following result :-

Procedure AnyNumberArguements received:
Procedure AnyNumberArguements received:
1 Procedure AnyNumberArguements received:
2 3 Procedure AnyNumberArguements received:
4 5 6 Procedure AnyNumberArguements received:
7 8 9 10 11 12

regards
Shouvik

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.