I am passing two double arrays to a function that multiplies them together at corresponding indexes and sends back the sum of all products as a double. I know that the function treats the arrays as variant/double arrays but my understanding was that this did not matter. I appreciate your advice and criticism ahead of time. By the way, this code is almost a direct translation from Fortran77 and I am trying to change as little as possible.
Option Explicit
Option Base 1
Function DOT(AA, BB, n)
Dim i As Integer
Dim DUM1 As Double
DOT = 0#
For i = 1 To n
DUM1 = AA(i) * BB(i)
DOT = DOT + DUM1
Next
End Function
At line 8, AA(i) and BB(i) are coming up as type mismatch. AA and BB are passed in as double arrays and n is passed in as an integer.
Edit: I just realized I was passing in a doubles and not the entire array. Code was fine after all. Thank you please delete this thread if needed.
Bookmarks