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

Home » Public Forums » archive » Feature request: printing very long arrays
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: Feature request: printing very long arrays [message #91153 is a reply to message #91147] Tue, 09 June 2015 08:57 Go to previous messageGo to previous message
Lajos Foldy is currently offline  Lajos Foldy
Messages: 176
Registered: December 2011
Senior Member
On Tuesday, June 9, 2015 at 3:43:33 PM UTC+2, john.c...@gmail.com wrote:
> On Monday, June 8, 2015 at 8:48:47 AM UTC-4, Helder wrote:
>> Hi,
>> I don't know if this happens only to me, but sometimes while debugging I like to look at what's inside a variable. Most of the times I use the command:
>>
>> help, variable
>>
>> and sometimes
>>
>> print, variable
>>
>> However, sometimes I'm too eager to look at what's hidden under the name and I go directly for the print option. And if I'm so stupid to do that on array of say 4096 x 4096 elements... well it takes a while and the only way to stop this useless overflow of data is to kill the IDL process.
>>
>> Is there a chance we a print command that looks like this:
>>
>> IDL> print, veryBigVariable
>> [ 0 1 ... 999998 999999]
>>
>> and
>> IDL> print, veryBigVariable, /fullPrint
>> 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
>> 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65
>> ....
>>
>> well you got the point.
>>
>> Any chance of this showing up in the future?
>>
>> Cheers,
>> Helder
>
>
> +1 to this request, as I have made the same mistake too many times to count. I would guess there are backwards compatibility issues here though.
>
> John

You can write your own print procedure, something like:

pro myprint, x, fullprint=full
help, x
n=n_elements(x)
if n le 10 or keyword_set(full) then print, x $
else print, x[0:4], '...', x[n-5:n-1]
end

regards,
Lajos
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: trouble with image(), /data, /norm
Next Topic: Extraction from *.txt file

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

Current Time: Wed Oct 08 11:49:15 PDT 2025

Total time taken to generate the page: 0.00452 seconds