KennyT
Joined: 02 Aug 2005 Posts: 318
|
Posted: Fri May 01, 2009 11:00 am Post subject: How to find the memory space occupied by a TYPE structure |
|
|
I'm away from my office (where the FTN95 manual is!) and I need to be able to update the contents of a structure, when I only have access to its address.
Currently, I have:
TYPE (RSCA) :: SCALAR
.
.
SCALAR = TRANSFER(CORE4(IADDRESS), SCALAR)
Which successfully COPIES the databytes at IADDRESS into the SCALAR structure. But SCALAR is at a different address to IADDRESS. So, when I make a change to SCALAR%STR, that doesn't affect the data at IADDRESS. So, how do I transfer the changed information back to IADDRESS?
I have a function called CopyBytes, which just calls
MOVE@ (CCORE1(IAD1), CCORE1(IAD2), N)
But I need to know what to set "N" to. I could just look at my TYPE definition for RSCA and add them up, but, if possible, I'd prefer to have code to do it for me, in case I change the TYPE definition.
I'm sure it's simple, but I just can't find any reference to how to do it!
Thanks
K |
|