PDA

View Full Version : ByRef argument type mismatch... Help me



catohcat
10-20-2005, 02:33 AM
I know what this error is and have searched our forum but still cant figure it out... Please help me


Version of the program : Visual basic 6
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

Killian
10-20-2005, 03:56 AM
Hi and welcome to VBAX :hi:

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