Hallo Leute,
ich habe folgendes Problem:
Ich bekomme den o.g. Fehler beim kompilieren. Woran liegt das?
Ich greife auf folgendes Sub zu:
[code]Sub ReadInUebergabe(ByRef ResultArr As Double)
'reads in the file line by line and delivers a double-array filled with the values behind seperator
Dim InputData As String
Dim inthandle As Integer
Dim sfile As String
Dim seperator As String
Dim comma As String
Dim plus As String
Dim strresult As String
Dim result As Double
Dim counter As Long
Dim height As Integer
Dim width As Integer
spath = "H:\Studium\Diplomarbeit\test\"
sfile = "Uebergabe.dat"
seperator = vbTab
inthandle = FreeFile
width = 5
height = 2
'initializes an 2-D-array typ double with heigth: numbvar and width popsize
ReDim ResultArr(height, width)
'fills the array with values
If spath & sfile <> "" Then
Open spath & sfile For Input As #inthandle
For m = 1 To width
For n = 1 To height
Line Input #inthandle, InputData
strresult = MyExtract(InputData, 2, "F", seperator) 'extracts a stringvalue behind tab
comma = Replace(strresult, ".", ",") 'replaces the "." with an ","
plus = Replace(comma, "+", "") 'deletes the "+" sign in string
ResultArr(n, m) = CDbl(plus) 'converts the edited string into a double
Next n
Next m
Close #1
Else: MsgBox "Datei nicht vorhanden"
End If
'check
'MsgBox word & " Wert: " & result
End Sub[/code]
mit folgendem sub versuche ich dann das zurückgegebene array zu bekommen:
[code]Public Sub test()
Dim Arr() As Double
Call ReadInUebergabe Arr()
MsgBox Arr(1, 1)
End Sub[/code]
komisch ist, dass es mit einem eindimensionalen array funktioniert....
Viele Grüße
Guddy |