comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: What in the world does "Program code area full" mean?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: What in the world does "Program code area full" mean? [message #67686 is a reply to message #67685] Wed, 12 August 2009 15:11 Go to previous messageGo to previous message
wlandsman is currently offline  wlandsman
Messages: 743
Registered: June 2000
Senior Member
On Aug 12, 5:18 pm, David Fanning <n...@dfanning.com> wrote:
>
> Yes, IDL is really not designed to run one gigantic
> line of code like this. You would be MUCH better
> served if you did a global delete of all "&$" marks
> and put an END at the end of your code, gave it
> a name (something like "disaster.pro" would be OK),
>
Early one in one's IDL programming life, one learns not to write a
single long line of code like this. But I only recently appreciated
how using EXECUTE() is similar to writing a single line of code -- you
better be careful if it gets too long! The problem came up in code
I have that uses EXECUTE() to dynamically create a structure. The
little code program below will probably fail with a "Code Area Full"
at some point -- depending on your machine -- when the execute string
becomes too long.

pro test
FOR i=100, 600 DO BEGIN
;;Get unique names for elements, make sure they are 8 long
exstring = 'a={' + $
STRJOIN( STRING(INDGEN(i),FORMAT='("TAG",I05,":0.0d0")'),',') +
'}'
res = EXECUTE(exstring)
IF res EQ 0 THEN MESSAGE,"Execute failed on "+STRING(i)
ENDFOR
return
end

The problem is not that the structure itself is too large - it can
easily be created if one puts the structure definition in a procedure
file and compiles it. (This is one of the ways to get around the
problem. The other way is to break up the structure definition
into chunks and then combine the substructures with CREATE_STRUCT() --
this is the method used by mrd_struct.pro =
http://idlastro.gsfc.nasa.gov/ftp/pro/structure/mrd_struct.p ro )

One thing that confused me was that, in ancient days, EXECUTE() had
strict limits on the number of characters. Then sometime in IDL
5.x these limits were removed, giving the impression that one could
use arbitarily long strings within EXECUTE(). But in fact it is
subject to the same code memory limits as when writing a program as a
single line of code. --Wayne
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Modis Conversion Toolkit Question
Next Topic: m choose n

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sat Oct 11 11:27:55 PDT 2025

Total time taken to generate the page: 0.50243 seconds