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

Home » Public Forums » archive » Re: How to convert (concatenate) a string array to a string scalar?
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: How to convert (concatenate) a string array to a string scalar? [message #19276] Mon, 13 March 2000 00:00 Go to previous message
Martin Schultz is currently offline  Martin Schultz
Messages: 515
Registered: August 1997
Senior Member
Kristian Kjaer wrote:
>
> Given
> numarray= ;, say, I wan't
> strscalar='1342,1347,1355' ;, but
> help,string(numarray)
> gives: STRING = Array
> and
> help,total(string(numarray))
> gives an error.
>
> How to convert (concatenate) a string array to a string scalar?
>
> Thanks for any help,
> Kristian Kj�r.

Try:

help,string(numarray,format='(3A)')
(no loop ;-)

Cheers,
Martin


PS: In case you don't know the array dimension exactly, the format
method also
works:
help,string(numarray,format='(9999A)')
But don't go beyond 32767!

And here is another (academic) solution:
help,string(reform(byte(string(numarray)),24))


--
[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[ [[[[[[[
[[ Dr. Martin Schultz Max-Planck-Institut fuer Meteorologie [[
[[ Bundesstr. 55, 20146 Hamburg [[
[[ phone: +49 40 41173-308 [[
[[ fax: +49 40 41173-298 [[
[[ martin.schultz@dkrz.de [[
[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[ [[[[[[[
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: need help MS powersation fortran external
Next Topic: Re: matching lists

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

Current Time: Wed Oct 08 15:28:12 PDT 2025

Total time taken to generate the page: 0.00410 seconds