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

Home » Public Forums » archive » Re: Declaring large vectors in IDL
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: Declaring large vectors in IDL [message #70484 is a reply to message #70480] Sat, 17 April 2010 01:02 Go to previous messageGo to previous message
fgg is currently offline  fgg
Messages: 67
Registered: April 2010
Member
On Apr 16, 6:35 pm, pp <pp.pente...@gmail.com> wrote:
> On Apr 16, 10:17 pm, fgg <fabioguimaraesgoncal...@gmail.com> wrote:
>
>> ... and I'd like to add it to the variables view. When I type @'path/
>> batchfilename.pro' at the IDL prompt, I get the following message: "%
>> Program code area full". Any suggestions?
>
> Do not write large literals, like that one. You just demonstrated one
> of the several reasons not to do it. Put those numbers into a file,
> then read it into the variable.
>
> There are many ways to read those values from a file, depending on how
> you write them into the file. If all you do is strip the "a = [" and
> the "]" from the ends of that file, you could read it as
>
> nl=file_lines('file.txt')
> a=strarr(nl)
> openr,unit,'file.txt',/get_lun
> readf,unit,a
> free_lun,unit
> a=strjoin(a)
> a=strsplit(a,',',/extract)
> a=fix(a)
>
> There are much simpler ways to read it, if the file is written a
> little differently.


Thanks for the suggestion. But what if the text file has more than one
variable in it? Say "a" and "b".
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Comparison operators and floating-point errors
Next Topic: Re: Virtual machine popup

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

Current Time: Thu Oct 09 02:58:49 PDT 2025

Total time taken to generate the page: 0.40048 seconds