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

Home » Public Forums » archive » Null terminated strings
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: Null terminated strings [message #28741 is a reply to message #28677] Wed, 09 January 2002 02:26 Go to previous messageGo to previous message
Malcolm Walters is currently offline  Malcolm Walters
Messages: 8
Registered: October 2001
Junior Member
"James Kuyper" <kuyper@gscmail.gsfc.nasa.gov> wrote in message
news:3C3B5D8D.9050806@gscmail.gsfc.nasa.gov...
>
> You're relying there on the fact that btest is a two-dimensional array;
> string() converts each row into a seperate string. In the case I'm
> worrying about, I would have a single IDL string, containing null
> characters at arbitrary positions. Try the following:
>
> btest = [84B,104B,105B,115B,0B,105B,115B,0B,97B,0B,106B,101B,115B,11 6B]
> stest = string(btest)
>
> All you get in stest is the 'This'.
>

Personally I would do this in two stages,
Firstly if you replace each 0B with a 10B using
btest[where(btest eq 0B)]=10B
you can now print btest then you get the line breaks (This can be used in
message boxes etc.)
Or if you want to go one further then split them using
stest = strsplit(string(btest),string(10B),/extract)
print, stest
This is a jest
help,stest
<Expression> STRING = Array[4]
I hope this is of some help.
Malcolm Walters
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: WIDGET REALIZATION BUG in 5.5 ?
Next Topic: Re: Spherical Contour Plotting

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

Current Time: Wed Oct 22 01:10:55 PDT 2025

Total time taken to generate the page: 2.23900 seconds