Consulting

Results 1 to 2 of 2

Thread: ByRef argument type mismatch... Help me

  1. #1

    ByRef argument type mismatch... Help me

    I know what this error is and have searched our forum but still cant figure it out... Please help me

    1. Version of the program : Visual basic 6
    2. What you want it to do : Passing values Back from Sub procedures
    Here's the part of the program, the error message keep happening to the Bold statement

    Private Sub cmdCal_Click()

    Dim t1, t1d, t2, t2d, m1, m2, l1, l2, h As Double
    ' below is to convert from Text box to number
    t1 = CDbl(txtT1.Text)
    t1d = CDbl(txtT1d.Text)
    t2 = CDbl(txtT2.Text)
    t2d = CDbl(txtT2d.Text)
    m1 = CDbl(txtM1.Text)
    m2 = CDbl(txtM2.Text)
    l1 = CDbl(txtL1.Text)
    l2 = CDbl(txtL2.Text)
    h = CDbl(txtH.Text)
    ............
    Do Until stopper= True

    Call RungeKutta(t1, t1d, t2, t2d, m1, m2, l1, l2, h, yj(1), yj(2), yj(3), yj(4))
    . .........
    Loop

    End sub

    Private Sub RungeKutta(t1s As Double, t1ds As Double, t2s As Double, t2ds As Double, m1s As Double, m2s As Double, l1s As Double, l2s As Double, hs As Double, yj1 As Double, yj2 As Double, yj3 As Double, yj4 As Double)
    .... ...

    End Sub

  2. #2
    VBAX Master Killian's Avatar
    Joined
    Nov 2004
    Location
    London
    Posts
    1,132
    Location
    Hi and welcome to VBAX

    You appear to have an array, yj() that isn't declared (or is elsewhere in the code but out of scope). If this isn't declared as an array of Doubles, you'll get a type mismatch
    K :-)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •