- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
I have a DLL, with a stub along the lines of
sub DoStuff(iStatus)
double precision, allocatable:: work(:)
if (iStatus .eq. 1) then
allocate(work(mySize), STAT = iDid)
elseif (iiStatus .eq. 2) then
deallocate(work, STAT = iDid)
endif
The allocation works. When the subroutine is called a second time, the work array has been deallocated. I thought that an allocated array stayed allocated until an explicit deallocate. Do I need a SAVE atribute to be added to this array?
On a different note, the DLL works the first time it is called. It will run in the debugger when I step through it. When I do not step through it, or when I run it outside the debugger, it crashes. If, within the VB caller, I add a Debug.Print statement upon the return from the subroutine, it again runs. Any idea as to the cause of this behaviour?
Link kopiert
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
- RSS-Feed abonnieren
- Thema als neu kennzeichnen
- Thema als gelesen kennzeichnen
- Diesen Thema für aktuellen Benutzer floaten
- Lesezeichen
- Abonnieren
- Drucker-Anzeigeseite