Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
28602 Discussions

Initializing variables call VF from VB several times

bjornk
Beginner
248 Views
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)
0 Kudos
1 Reply
Jugoslav_Dujic
Valued Contributor II
248 Views
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
0 Kudos
Reply