- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Ever thought you figured out a problem and then realized you still have not got a clue to how to fix it ?
I have read all the help and documentation but still cannot get VB to properly call a Fortran DLL. I am using Excel as a front end interface to some Fortran routines. I can pass double precision numbers and integers but cannot pass arrays. When I try to pass the array by specifying the first position of an array, d, only the first element is changed (i.e. CALL myroutine(d(1))).
Does anyone have any pieces of code or point to examples that shows how to properly call a FORTRAN DLL and pass mixtures of integers, arrays, multidimentional arrays of double precision numbers, etc. ?
My only other alternative is to write the data to a file to be accessed by VB and Fortran but that is so cave-man like I prefer not to.
Thanks in advance.
Jon
I have read all the help and documentation but still cannot get VB to properly call a Fortran DLL. I am using Excel as a front end interface to some Fortran routines. I can pass double precision numbers and integers but cannot pass arrays. When I try to pass the array by specifying the first position of an array, d, only the first element is changed (i.e. CALL myroutine(d(1))).
Does anyone have any pieces of code or point to examples that shows how to properly call a FORTRAN DLL and pass mixtures of integers, arrays, multidimentional arrays of double precision numbers, etc. ?
My only other alternative is to write the data to a file to be accessed by VB and Fortran but that is so cave-man like I prefer not to.
Thanks in advance.
Jon
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
on,
Regarding to your problem that only the first element of array is passed from BB to FORT RAN DELL, I ran into a similar situation before. I found the solution by accident. Anyway, in your BB code, when you declare your multidimensional arrays, declare each of them separately. For example,
Dim arr1(1 to 10, 1 to 10)
Dim arr2(1 to 10, 1 to 10)
and not
Dim arr1(1 to 10), arr2(1 to 10)
Hopefully this is helpful.
Yeong
Regarding to your problem that only the first element of array is passed from BB to FORT RAN DELL, I ran into a similar situation before. I found the solution by accident. Anyway, in your BB code, when you declare your multidimensional arrays, declare each of them separately. For example,
Dim arr1(1 to 10, 1 to 10)
Dim arr2(1 to 10, 1 to 10)
and not
Dim arr1(1 to 10), arr2(1 to 10)
Hopefully this is helpful.
Yeong
![](/skins/images/1FC86CD46823E418D1E2B7B4DC10231C/responsive_peak/images/icon_anonymous_message.png)
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page