Subroutines multiple arguments

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

    #1

    Subroutines multiple arguments

    Hi,

    This might be a dumb question but i'm trying to pass a couple of
    arguments to a subroutine and keep getting an error message

    This:

    Sub showNumbers(a As Integer)
    MsgBox (a & ", " & a)

    End Sub


    Private Sub Command0_Click( )
    showNumbers (1)

    End Sub

    Works Fine!




    But This:

    Sub showNumbers(a As Integer, b As Integer)
    MsgBox (a & ", " & b)

    End Sub

    Private Sub Command0_Click( )
    showNumbers (1, 2)

    End Sub

    gives a syntax error..

    Any help much appreciated..

    thanks

    jim

  • paii, Ron

    #2
    Re: Subroutines multiple arguments

    Try calling like this

    showNumbers 1,2


    "jim" <jim@j.comwro te in message
    news:crCdnYXkn-OkTLvUnZ2dnUVZ8 jOdnZ2d@posted. metronet...
    Hi,
    >
    This might be a dumb question but i'm trying to pass a couple of
    arguments to a subroutine and keep getting an error message
    >
    This:
    >
    Sub showNumbers(a As Integer)
    MsgBox (a & ", " & a)
    >
    End Sub
    >
    >
    Private Sub Command0_Click( )
    showNumbers (1)
    >
    End Sub
    >
    Works Fine!
    >
    >
    >
    >
    But This:
    >
    Sub showNumbers(a As Integer, b As Integer)
    MsgBox (a & ", " & b)
    >
    End Sub
    >
    Private Sub Command0_Click( )
    showNumbers (1, 2)
    >
    End Sub
    >
    gives a syntax error..
    >
    Any help much appreciated..
    >
    thanks
    >
    jim
    >

    Comment

    Working...