- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have a VB program that is calling a fortran dll. I can call the fortran dll several times from VB, but when I call the fortran dll the second time (without exiting VB) the variables in the fortran dll are are not initilized. I am wondering if there is a function to reset all the variables in the fortran dll. (without having set to initialize all variabaes in the code)
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
No, there's no way. And the code needs fixing anyway -- there's no guarantee that variables will be zero-initialized even for the first time (although it frequently happens to be so with default compiler switches).
I recommend using "Enable recursive routines" (/recursive), or "Variables default to automatic" (/automatic) compiler switches. Note that they do exactly the opposite of what you asked -- they (tend to) initialize all local variables with garbage, and turn off default SAVE semantics. In addition, they help compiler towarn you against"uninitialized variables" -- make sure to turn that on in "diagnostic" category. If you manage to change the code and make it legal, and it producesgood results with one of these switches, then you got the "real good" code. As it is now, it probably just happens to work.
Jugoslav
![](/skins/images/8B5EA638CA3587CA763EE9EF53643DD4/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