- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I made a fortran dll that I want to use in VB How do I send the location and name of the at file to the dll? Can I send it the path name as a variable (assuming the at file is in a different location that the dll)?
Can I assign UNIT numbers to different locations (yes, I know there are default unit numbers)? Where do I do that?
Suppose I made a different dll that reads and writes to an Access data base, how do I do that? Specifically, do I use OPEN statements? What would the UNIT number be? If I want certain read statements to be assocaited with certain locations in the database (ie: rec=14), how will I know what the record numbers are associated to which record? Now, when they say record number, is that refering to a cell? a sheet? a database? And, if the data base is in a different location than the dll, how do I tell the dll where to find the database?
And lastly, if you could point me in the direction of some good (helpful) books regarding these more complex questions, I would greatly appreciate it.
Thanks.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
OPEN (UNIT=3.FILE="D:MYPATHFILE.DAT",FORM="FORMATTED")
The unit number can be any non-negative integer you want, though I suggest avoiding 0, 5 and 6.
You can pass a file name as a character argument from VB to VF, though you have to specify that is passed "by val". See the mixed-language chapter of the Visual Fortran Programmer's guide for more details.
Fortran direct access files are not the same as a spreadsheet or MS Access database - they are a series of fixed-length records addressed by record number (starting with 1). You determine what the association is.
If you want to read Excel or Access files, I suggest looking at Canaima Software's f90SQL library.
I would suggest looking through the Programmer's Guide - you can buy a printed copy if you prefer. It also sounds as if you could use some "brushing up" on the Fortran language. One of the books I like best is "Fortran 90/95 for Scientists and Engineers" by Stephen Chapman. You can get it from your favorite bookseller or through the Compaq Fortran Online Bookstore.
Steve
![](/skins/images/872293744008A34B36F8ABF94A46CC66/responsive_peak/images/icon_anonymous_message.png)
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page