[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: string to array conversion



Hi Alex, thanks for your answer,
I want to change the stringlength or produce new strings (delete and add
some words), example:

a=string('llllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll')

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 ?

        Karsten


Alex Schuster schrieb:

> Karsten Schmidt wrote:
>
> > I want to create very long strings (300 characters and more), but
> > sometimes IDL makes an array with three or four dimensions. How can I
> > stop this conversion ?
>
> Can you give us an example of what exactly you are doing? I did not
> encounter this behaviour before, strings have always worked fine for me.
>
> IDL> help, string( bytarr( 20000 ) + 65b )
> <Expression>    STRING    =
> 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA'...
>
>         Alex
> --
>   Alex Schuster     Wonko@weird.cologne.de          PGP Key available
>                     alex@pet.mpin-koeln.mpg.de