replica nfl jerseysreplica nfl jerseyssoccer jerseyreplica nfl jerseys forums.silverfrost.com :: View topic - How to find the memory space occupied by a TYPE structure
forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How to find the memory space occupied by a TYPE structure

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support
View previous topic :: View next topic  
Author Message
KennyT



Joined: 02 Aug 2005
Posts: 318

PostPosted: Fri May 01, 2009 11:00 am    Post subject: How to find the memory space occupied by a TYPE structure Reply with quote

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
Back to top
View user's profile Send private message Visit poster's website
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 8209
Location: Salford, UK

PostPosted: Fri May 01, 2009 3:47 pm    Post subject: Reply with quote

I think you can use INQUIRE together with the keyword argument IOLENGTH.
Just like a WRITE statement.

INQUIRE(IOLENGTH=IOL) <iolist>

where IOL is an integer to receive the length in bytes probably.
Back to top
View user's profile Send private message AIM Address
KennyT



Joined: 02 Aug 2005
Posts: 318

PostPosted: Sat May 02, 2009 7:36 am    Post subject: Reply with quote

Thank you. Works perfectly.


K
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
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