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

Home » Public Forums » archive » string to array conversion
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: string to array conversion [message #21162 is a reply to message #21005] Thu, 10 August 2000 00:00 Go to previous messageGo to previous message
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
Karsten Schmidt (k.schmidt@vermes.fh-oldenburg.de) writes:

> Hi Alex, thanks for your answer,
> I want to change the stringlength or produce new strings (delete and add
> some words), example:
>
> a=string('llllllllllllllllllllllllllllllllllllllllllllllllll llllllllllllllllllllllllllllllllllllllllllllllllllllllllllll llllllllllllllllllllllllllllllllllllllllllllllllllllllllllll llllllllllllllllllllllllllllllllllllllllllllllllllllllllllll llllllllllllllllllllllllllllllllllllllllll')
>
> print,strlen(a)
> 272
> help,a
> A STRING =
> 'lllllllllllllllllllllllllllllllllllllllllllll'...
> that's allright,
> but if I write:
> word=string('long strings are my problem')
> together=string(word,word,word,word,word,word,word)
> print,strlen(together)
> 162 27
> help,togehter ==> TOGETHER STRING = Array[2]
>
> What's happen and how can I stop it ?

If you want to string words together, you should
use the + sign:

IDL> word1 = 'Hello '
IDL> word2 = 'Karsten'
IDL> word3 = ': How are you?"
IDL> sentence = word1 + word2 + word3
IDL> Print, sentence

Hello Karsten: How are you?

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: A related question...
Next Topic: Reading in text data

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

Current Time: Sat Oct 11 12:15:29 PDT 2025

Total time taken to generate the page: 0.71849 seconds