Re: Workaround for "Program unit has too many local variables"? [message #7285 is a reply to message #7283] |
Wed, 23 October 1996 00:00  |
Liam Gumley
Messages: 473 Registered: November 1994
|
Senior Member |
|
|
Charlie Zender wrote:
> IDL 3.6 will not compile a procedure that has grown rather large.
> the error message is:
> "Program unit has too many local variables"
> is there a workaround to this which does not involve rewriting
> the procedure? e.g., is there a system variable i can set to
> increase the # of local variables allowed?
You probably need to increase the memory used for compiling programs.
This is done with the .SIZE command, e.g.
.SIZE 60000 20000
which resizes the code and data areas to 60000 and 20000 bytes
respectively (the default is 32768 and 8192 bytes respectively). There
is an upper limit for the code and data size for each O/S. This will
help you out up to a point. If you have lots of arrays defined in your
program (like you would do with DATA statements in FORTRAN), then you
might not be able to increase the code and data areas to a large enough
size (the program will still fail to compile). In this case, you will
have to store your variables in data files, and read them on start-up. I
know this can be inconvenient, but it's just the way IDL works. The
other option is to break up your program into a number of smaller
procedures/functions, since every procedure/function has it's own
code/data space.
Cheers,
Liam.
|
|
|