|
forums.silverfrost.com Welcome to the Silverfrost forums
|
View previous topic :: View next topic |
Author |
Message |
KennyT
Joined: 02 Aug 2005 Posts: 317
|
Posted: Thu Jan 12, 2012 1:25 pm Post subject: Pointers, pointers, pointers! |
|
|
Got a wierd situation. I have a routine (QW_SetAdr defined in a separate DLL) that displays a value on the screen. When it is passed a variable defined through a pointer to a structure variable, it behaves inconsistently. So, to give a coding example:
In the following, CPH is defined in a module and populated elsewhere
Code: | TYPE(PHRES), POINTER :: PH
.
.
PH=>CPH
.
.
CALL QW_SetADR (IS, IFLD, PH%Avalue) |
Fails to update the field on the screen cleanly.
But…
Code: | TYPE(PHRES), POINTER :: PH
.
.
PH=>CPH
.
.
AVALUE = PH%Avalue
CALL QW_SetADR (IS, IFLD, Avalue) |
…Works
And…
Code: | TYPE(PHRES) :: PH
.
.
PH=CPH
.
.
CALL QW_SetADR (IS, IFLD, PH%Avalue) |
…Works as well
If I try stepping through the code under /debug, it all works OK, but if I just run the app, regardless of whether the relevant code is compiled under /debug or not, sometimes it works, sometimes it doesn't.
Any ideas?
TIA
K |
|
Back to top |
|
|
KennyT
Joined: 02 Aug 2005 Posts: 317
|
Posted: Thu Jan 12, 2012 2:49 pm Post subject: |
|
|
OK, sussed it! The routine that displays the value is using the LOC of the variable and was testing for that being .le.0, and, of course, under 64-bit OS, the 4-byte addresses can and do go negative!
K |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|