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

Home » Public Forums » archive » Re: String composition
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: String composition [message #38127] Mon, 23 February 2004 06:21
Norbert Hahn is currently offline  Norbert Hahn
Messages: 46
Registered: May 2003
Member
Edd Edmondson <eddedmondson@hotmail.com> wrote:

> Antonio Santiago <d6522117@est.fib.upc.es> wrote:
>> Hi, sorry about this poor question, but is my first problem with IDL.
>
>> How can i mount a string with a return carriadge. That is like C:
>
>> string = 'hello \n'+ 'bye'
>
>> How can i put the '\n' character?
>
> STRING(10B) (10 being the ascii code for a new line)
>
> eg, mystring='hello'+STRING(10B)+'bye'

That's ok for Unix like operating systems. MS Windows requires

mystring='hello'+STRING([13B,10B])+'bye'

while the Macintosh needs mystring='hello'+STRING(13B)+'bye'
if I'm not mistaken.

You may use the variable !version.os to find out which OS your
program runs on.

Norbert
Re: String composition [message #38132 is a reply to message #38127] Mon, 23 February 2004 04:14 Go to previous message
Edd Edmondson is currently offline  Edd Edmondson
Messages: 50
Registered: January 2003
Member
Antonio Santiago <d6522117@est.fib.upc.es> wrote:
> Hi, sorry about this poor question, but is my first problem with IDL.

> How can i mount a string with a return carriadge. That is like C:

> string = 'hello \n'+ 'bye'

> How can i put the '\n' character?

STRING(10B) (10 being the ascii code for a new line)

eg, mystring='hello'+STRING(10B)+'bye'

--
Edd
Re: String composition [message #38133 is a reply to message #38132] Mon, 23 February 2004 04:10 Go to previous message
Pepijn Kenter is currently offline  Pepijn Kenter
Messages: 31
Registered: April 2002
Member
Antonio Santiago wrote:
> Hi, sorry about this poor question, but is my first problem with IDL.
>
> How can i mount a string with a return carriadge. That is like C:
>
> string = 'hello \n'+ 'bye'
>
> How can i put the '\n' character?
>
> thanks
>
You can use C-style format codes like this:

print, format='(%"hello\nbye")'

Pepijn.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: x-axis as long as y-axis ?
Next Topic: Re: Mark directory for exclusion from !PATH

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

Current Time: Wed Oct 08 13:40:00 PDT 2025

Total time taken to generate the page: 0.00625 seconds