- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
To send a bunch of data from ms-excel to Fortran it must be cast into anarray of the right type.
e.g.
---------------
Dim X() as double: Redim X(1 to n, 1 to m)
For j=1 to m
For i=1 to n
X(I,j)=sheets("Sheet1").range("A1").offset(I,j)
Next:
Next
Stepping through the code it is MUCH faster to say:
X = Sheets("Sheet1").range("A1").resize(nRows, nCols)
with (I assume) X as a variant array because itdoes not need to be declared.
Now the first choice takes much longer than the second. But only VBA understands the second to be an array
1. Either this is a zero sum game and the second choice just picks up a pointer and later when X is accessed in VBA the memory-access delay occurs. OR....
2. The second choice really is faster, in which case, I would like to know:
Is there a way to pass the second X to a F90 DLL?
Thanks a bushel.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page