|
Re: how to create a string of 1024 spaces? [message #55590 is a reply to message #55589] |
Sat, 01 September 2007 19:30  |
Craig Markwardt
Messages: 1869 Registered: November 1996
|
Senior Member |
|
|
Tinwai <wangthth@gmail.com> writes:
> How to create a string S which consists 1024 spaces, like '
For understandability, I like David's answer.
For hack value, this is the best I could do:
a=' '&for j=0,9 do a=a+a
Craig
--
------------------------------------------------------------ --------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@REMOVEcow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
------------------------------------------------------------ --------------
|
|
|
Re: how to create a string of 1024 spaces? [message #55598 is a reply to message #55590] |
Fri, 31 August 2007 07:39  |
R.Bauer
Messages: 1424 Registered: November 1998
|
Senior Member |
|
|
Reimar Bauer wrote:
> Tinwai wrote:
>> How to create a string S which consists 1024 spaces, like '
>> ' ? Thx
>>
>
> IDL> a=make_array(1024,1,val=32b,/byt)
> IDL> help,string(a)
>
> <Expression> STRING = '
> '...
>
> IDL> print,strlen(string(a))
> 1024
>
> cheers
> Reimar
or similiar
a=systime(1)&txt=string(bytarr(1024,1)+32b)&print,sy stime(1)-a
cheers
Reimar
|
|
|
Re: how to create a string of 1024 spaces? [message #55599 is a reply to message #55598] |
Fri, 31 August 2007 07:32  |
R.Bauer
Messages: 1424 Registered: November 1998
|
Senior Member |
|
|
Tinwai wrote:
> How to create a string S which consists 1024 spaces, like '
> ' ? Thx
>
IDL> a=make_array(1024,1,val=32b,/byt)
IDL> help,string(a)
<Expression> STRING = '
'...
IDL> print,strlen(string(a))
1024
cheers
Reimar
|
|
|
|
Re: how to create a string of 1024 spaces? [message #55601 is a reply to message #55600] |
Fri, 31 August 2007 06:52  |
Maarten[1]
Messages: 176 Registered: November 2005
|
Senior Member |
|
|
On Aug 31, 1:46 pm, Tinwai <wangt...@gmail.com> wrote:
> How to create a string S which consists 1024 spaces, like '
> ' ? Thx
S = strjoin(replicate('a', 1024), /single)
Replace 'a' with ' ', but this is somewhat easier to debug.
Maarten
|
|
|