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

Home » Public Forums » archive » Re: how to create a string of 1024 spaces?
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: how to create a string of 1024 spaces? [message #55589] Mon, 03 September 2007 02:38
Tinwai is currently offline  Tinwai
Messages: 3
Registered: July 2007
Junior Member
Nice answers. Thank you all.
Re: how to create a string of 1024 spaces? [message #55590 is a reply to message #55589] Sat, 01 September 2007 19:30 Go to previous message
Craig Markwardt is currently offline  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 Go to previous message
R.Bauer is currently offline  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 Go to previous message
R.Bauer is currently offline  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 #55600 is a reply to message #55599] Fri, 31 August 2007 07:00 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Tinwai writes:

> How to create a string S which consists 1024 spaces, like '

blankString = String(Replicate(32B, 1024))

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: how to create a string of 1024 spaces? [message #55601 is a reply to message #55600] Fri, 31 August 2007 06:52 Go to previous message
Maarten[1] is currently offline  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
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Programmatic size adjustment of widgets under Windows vs. UNIX (was "Natural size of explicitly-sized widget")
Next Topic: Placing constraints on Interpol

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

Current Time: Fri Oct 10 14:06:05 PDT 2025

Total time taken to generate the page: 1.04737 seconds