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

Home » Public Forums » archive » Re: Array string
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: Array string [message #38124] Mon, 23 February 2004 09:30
Pavel Romashkin is currently offline  Pavel Romashkin
Messages: 166
Registered: April 1999
Senior Member
How about

strjoin(myArray, ' ')

Pavel

Julio wrote:
>
> Hi,
> I have an array string with 6 columns and 4 lines. In each array
> position I have words that I must extract. How can I do to transform
> this array in a 1 element string, with the words separated by spaces?
>
> Thanks in advance!
Re: Array string [message #38139 is a reply to message #38124] Sun, 22 February 2004 18:24 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Julio writes:

> I have an array string with 6 columns and 4 lines. In each array
> position I have words that I must extract. How can I do to transform
> this array in a 1 element string, with the words separated by spaces?

Just off the top of my head, how about something like this:

spaces = String(Replicate(32B,3)) ; Three spaces between words
words = Reform(array, 6*4)
line = words[0]
FOR j=1,N_Elements(words)-1 DO line = line + spaces + words[j]
Print, line

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting
Coyote's Guide to IDL Programming: http://www.dfanning.com/
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Mark directory for exclusion from !PATH
Next Topic: Re: IDLgrModel, rotation angles

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

Current Time: Wed Oct 08 11:41:00 PDT 2025

Total time taken to generate the page: 0.00447 seconds