Is there is simple way in QUIZ to find the position of the la st embedded space in a character string?

Whittall, Conrad Conrad.Whittall@Cognos.COM
Fri, 16 Nov 2001 15:17:29 -0500


Friday afternoon and I needed a little "light" diversion :-)

This might be what you're looking for...

DEFINE position_of_last_space   NUMBER*4                          &
     = SIZE ( TRUNCATE ( string_to_search ) )                     &
     - INDEX ( REVERSE ( TRUNCATE ( string_to_search ) ), " " )   &
     + 1

Best regards,
Conrad

-----Original Message-----
From: George_DeWolf@midhosp.org [mailto:George_DeWolf@midhosp.org]
Sent: Friday 16 November 2001 14:53
To: powerh-l@lists.swau.edu
Subject: Is there is simple way in QUIZ to find the position of the last
e mbedded space in a character string?


For example, if I have the following string where [sp] indicates a space

"ABC[sp]D[sp][sp]E"

I would like a value of 7 to be returned.  I'm using version 8.19.C5 of Quiz
on the HP3000.

= = = = = = = = = = = = = = = = = = = = = = = = = = = =
Mailing list: powerh-l@lists.swau.edu
Subscribe: "subscribe" in message body to powerh-l-request@lists.swau.edu
Unsubscribe: "unsubscribe" in message body to
powerh-l-request@lists.swau.edu
http://lists.swau.edu/mailman/listinfo/powerh-l
This list is closed, thus to post to the list you must be a subscriber.

This message may contain privileged and/or confidential information.  If you
have received this e-mail in error or are not the intended recipient, you
may not use, copy, disseminate, or distribute it; do not open any
attachments, delete it immediately from your system and notify the sender by
e-mail promptly that you have done so.  Thank You.