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

Home » Public Forums » archive » Symbol/data area for IDL procedures and functions
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Symbol/data area for IDL procedures and functions [message #1544] Sun, 28 November 1993 15:37
hadfield is currently offline  hadfield
Messages: 11
Registered: October 1993
Junior Member
I know this has come up before, but, as usual, I didn't realise its
relevance at the time. My question is: Can I increase the size of the
symbol area allocated to an IDL function or procedure? Background to this
question follows:

The IDL v3.1 Reference Manual warns against using EXECUTE to create new
variables inside procedures or functions, thus:

Do not use EXECUTE to create new variables
inside procedures or functions. All variables used
by the string that is executed should be referenced
or defined when the program unit is originally com-
piled. New variables cannot be created after a pro-
cedure or function is compiled. Attempts to create
new variables result in the error "Program data area
full".

However the adventurous will find that this is not entirely true.
Consider the following procedure:

pro exectest, vnum

snum = strtrim(string(vnum),2)

OK=execute("v"+snum+" = "+snum)

OK=execute("print, v"+snum)

end

This compiles OK and seems at first to execute OK. Thus typing "execute, 1"
leads to "1" being printed at the console. BUT, if called repeatedly the
procedure may fail, eg "for i=0,10 do exectest,i" fails from i=9 onwards with
"% Program data area full." messages.

Inserting calls to help in the procedure shows what is happening. At its
first call the procedure has 135 bytes in its "symbol area" (which I take to
be another name for the data area), of which 38 bytes are
used. Each time a new variable is created (v1, v2, etc) 10 bytes are taken.
The symbol area is not re-initialised each time the procedure is called, only
when it is recompiled.

So the question is: can I increase the amount of free space in a module's
symbol area? (Note that this is different from the main program's symbol
area, which I have set at the default value of 8192 bytes.)

============================================================ ===========
Mark Hadfield hadfield@storm.greta.cri.nz
NIWA Oceanographic (Taihoro Nukurangi) NIWAR1:HADFIELD
Wellington, New Zealand
[Message index]
 
Read Message
Previous Topic: NCSA HDF in IDL?
Next Topic: Re: Help with IDL STructure with variable string parameters to store

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

Current Time: Thu Oct 09 11:04:39 PDT 2025

Total time taken to generate the page: 0.31949 seconds