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

Home » Public Forums » archive » Re: write unix textfile with windows 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: write unix textfile with windows idl [message #37740 is a reply to message #37739] Wed, 21 January 2004 10:31 Go to previous messageGo to previous message
Michael Wallace is currently offline  Michael Wallace
Messages: 409
Registered: December 2003
Senior Member
> A work-around is to use writeu in stead of printf and use the string
> procedure to format the text, i.e. to write some text and a number, the
> following code works
>
> writeu, 1, String( "Hello word, the year is", 2004), 10B
>
> but looks ugly. Any other ideas?


You can use the format keyword of the string function to add a C-style
control character to the string. For UNIX, just add \n (newline) to the
end of your string. For Windows, add \r\n (carriage return and newline).

; UNIX version
writeu, 1, string('Hello World', format = '(%"%s\n")')

; Windows version
writeu, 1, string('Hello World', format = '(%"%s\r\n")')
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: again strsplit
Next Topic: Strange widget_info(FIND_BY_UNAME...) results

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

Current Time: Fri Oct 10 20:19:08 PDT 2025

Total time taken to generate the page: 1.52084 seconds