substitution of characters

Mike Palandri palandri@4j.lane.edu
Wed, 25 Aug 1999 06:13:03 -0700


Here's some quick code to perform the substitution:

TEMP    TI-LEN  INT*10
TEMP    TI-X    INT*10
TEMP    TC-IN   CHAR*40 INITIAL "THIS IS A TEST         !!" RESET AT
STARTUP
TEMP    TC-OUT  CHAR*40                                     RESET AT
STARTUP


PROCEDURE DESIGNER TEST NODATA
BEGIN
   LET TI-LEN = SIZE(TRUNC(TC-IN))
   LET TC-OUT = ""
   LET TI-X = 1
   WHILE TI-X <= TI-LEN
   BEGIN
      IF TC-IN[TI-X:1] = " "
         THEN LET TC-OUT = TRUNC(TC-OUT) + "_"
         ELSE LET TC-OUT = TRUNC(TC-OUT) + TC-IN[TI-X:1]
      LET TI-X = TI-X + 1
   END
END

At 02:01 PM 08/25/1999 +0200, Johan Koelewijn wrote:
>Hello,
>
>Is the following possible in powerhouse (quick,quiz) :
>
>I have an item (for example char*25) that contains "THIS IS A TEST
  
> " and I want
>to convert the spaces to underscores so that the item contains 
>"THIS_IS_A_TEST___________"
>
>Any suggestions ?
>
>Johan Koelewijn
>Van Dijk Delft BV
>johan@vandijkgroep.nl
>= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
= =
>Subscribe: "subscribe powerh-l" in message body to
majordomo@lists.swau.edu
>Unsubscribe: "unsubscribe powerh-l" in message to
majordomo@lists.swau.edu
>powerh-l@lists.swau.edu is gatewayed one-way to bit.listserv.powerh-l
>This list is closed, thus to post to the list, you must be a subscriber.
>

Mike