replica nfl jerseysreplica nfl jerseyssoccer jerseyreplica nfl jerseys forums.silverfrost.com :: View topic - How do I find out the size of an allocatable 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 do I find out the size of an allocatable 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: Mon Jan 17, 2011 11:18 am    Post subject: How do I find out the size of an allocatable structure? Reply with quote

I have a situation where some code works on my WinXP development machine but fails on my customers W2003 server. The program crashes in the "ALLOCATE" statement (despite it having a STAT= attribute). So, I want to check how much memory it is attempting to allocate (just to make sure that its not trying to allocate an "undefined" or "negative" size etc).

How can I do it? I thought "SIZE" might do it, but that just comes back with zero...

TIA

K
Back to top
View user's profile Send private message Visit poster's website
PaulLaidler
Site Admin


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

PostPosted: Mon Jan 17, 2011 12:32 pm    Post subject: Reply with quote

If you are allocating an array, does the SIZE intrinsic function give you a sensible result?

If you are nearing the 32bit integer limit for the size, you may need a recent version of the compiler to get a good result from ALLOCATE.
Back to top
View user's profile Send private message AIM Address
KennyT



Joined: 02 Aug 2005
Posts: 318

PostPosted: Mon Jan 17, 2011 1:22 pm    Post subject: Reply with quote

Sorry, should have made it clear in the text (not just the subject!). It's a structure, not an array.

K
Back to top
View user's profile Send private message Visit poster's website
PaulLaidler
Site Admin


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

PostPosted: Mon Jan 17, 2011 1:34 pm    Post subject: Reply with quote

I am not sure but can you use INQUIRE in this context?
Back to top
View user's profile Send private message AIM Address
KennyT



Joined: 02 Aug 2005
Posts: 318

PostPosted: Mon Jan 17, 2011 1:50 pm    Post subject: Reply with quote

That looks to have done it, thanks.

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