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

Home » Public Forums » archive » Re: print to a variable
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: print to a variable [message #5278 is a reply to message #5266] Mon, 20 November 1995 00:00 Go to previous messageGo to previous message
thompson is currently offline  thompson
Messages: 584
Registered: August 1991
Senior Member
gfu@shark.gsfc.nasa.gov (Gary Fu) writes:

> Hi,

> Is there a simple way to write outputs to a string variable that has
> the same result as by using the 'print' statement ?

> I'm asking something like 'sprintf' as to 'printf' in C.

Yes, you can use the STRING function with the /PRINT qualifier. For example,

IDL> print,indgen(10)
0 1 2 3 4 5 6 7 8
9
IDL> s = string(indgen(10),/print)
IDL> help,s
S STRING = Array(2)
IDL> print,s(0)
0 1 2 3 4 5 6 7 8
IDL> print,s(1)
9

Bill Thompson
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Representing graphs in IDL
Next Topic: Read Hex numbers

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

Current Time: Sat Oct 11 15:41:27 PDT 2025

Total time taken to generate the page: 0.95759 seconds