SDL-News: Array of char to Charstring


Subject: SDL-News: Array of char to Charstring
From: Helge Tepstad (AS/ETO) (helge.tepstad#ericsson.com)
Date: Mon Mar 15 2004 - 11:11:24 GMT


Become an SDL Forum Society member <http://www.sdl-forum.org/Society/members.htm>
The originator of this message is responsible for its content.
-----From "Helge Tepstad (AS/ETO)" <helge.tepstad#ericsson.com> to sdlnews -----

Hi,

I'm running Telelogic Tau SDL Suite 4.5.2 under Win2000 OS
I have a question regarding converting of array of char to Charstring sort.
Is it possible to, in a nice-looking way, to convert an array of char to a charstring ?
Perhaps an operator?

My array is defined as :

NEWTYPE CharArr_T
  Array (CharIdx_T, char)
ENDNEWTYPE CharArr_T;

SYNTYPE CharIdx_T = int
  CONSTANTS 1:16
ENDSYNTYPE CharIdx_T;

Normally I would convert this array of char to Charstring in this way :

DCL cStr Charstring := '';
DCL c1 CharArr_T;
for (DCL tmp_i int := 1, tmp_i < NameStringC, tmp_i+1)
      cStr := cStr // mkstring(c1(tmp_i));

But there has to be a nicer way to do this ?? Is there also a nice way to convert a Charstring to array of char ??
This problem also appears when I import a c-header file, where an array is defined as 'char c2[x]'.
> _________________________________
>
> Helge Tepstad
SW Engineer
Traffic Routing
> ERICSSON ///
> Phone: +47 67 25 00 00
> Fax: +47 67 25 00 01
> Dir. Phone: +47 45 24 94 15
> Mobile: +47 91 60 36 04
> Email: Helge.Tepstad#ericsson.com
> Adress: Lensmannslia 4, Asker
> Post: Ericsson AS, P.O.Box 164, N-1371 Asker, Norway
>

This communication is confidential and intended solely for the addressee(s). Any unauthorized review, use, disclosure or distribution is prohibited. If you believe this message has been sent to you in error, please notify the sender by replying to this transmission and delete the message without disclosing it. Thank you.

E-mail including attachments is susceptible to data corruption, interruption, unauthorized amendment, tampering and viruses, and we only send and receive e-mails on the basis that we are not liable for any such corruption, interception, amendment, tampering or viruses or any consequences thereof.

--End text from "Helge Tepstad (AS/ETO)" <helge.tepstad#ericsson.com> to sdlnews ---
For extra SDL Forum Society benefits join at <http://www.sdl-forum.org/Society/members.htm>



This archive was generated by hypermail 2a23 : Thu May 09 2013 - 16:05:50 GMT