visual basic 6 passing a control array as an argument

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • sfgsdfg

    visual basic 6 passing a control array as an argument

    Hello, is there a way to pass a control array to a function?
    i tried the following which works with normal arrays but not control
    arrays:(

    Private Sub Click1_Click()
    Calc txtControlArray , txtSingleContro l
    End Sub

    Private Sub Calc(L() As Control, Total As Control)
    Dim x As Integer
    Total = ""

    For x = 0 To L.UBound
    Total = Val(Total) + Val(L(x))
    Next
    End Sub


  • sfgsdfg

    #2
    Re: visual basic 6 passing a control array as an argument

    tis ok, found a solution in google groups...
    just changed:

    Private Sub Calc(L() As Control, Total As Control)
    to
    Private Sub Calc(L As Variant, Total As Control)

    "sfgsdfg" <sdfgdf@sdf.com > wrote in message
    news:41a263f7$0 $117$65c69314@m ercury.nildram. net...[color=blue]
    > Hello, is there a way to pass a control array to a function?
    > i tried the following which works with normal arrays but not control
    > arrays:(
    >
    > Private Sub Click1_Click()
    > Calc txtControlArray , txtSingleContro l
    > End Sub
    >
    > Private Sub Calc(L() As Control, Total As Control)
    > Dim x As Integer
    > Total = ""
    >
    > For x = 0 To L.UBound
    > Total = Val(Total) + Val(L(x))
    > Next
    > End Sub
    >[/color]


    Comment

    • J French

      #3
      Re: visual basic 6 passing a control array as an argument

      On Mon, 22 Nov 2004 22:17:59 -0000, "sfgsdfg" <sdfgdf@sdf.com > wrote:
      [color=blue]
      >tis ok, found a solution in google groups...
      >just changed:
      >
      >Private Sub Calc(L() As Control, Total As Control)
      >to
      >Private Sub Calc(L As Variant, Total As Control)[/color]

      You can also pass a Control Array as an Object

      Comment

      Working...