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

Pickering, John (NORBORD) PICKERIJ@norbord.com
Fri, 16 Nov 2001 15:30:20 -0500


Yeah, Conrad's got it right!

I didn't read the problem correctly before scribbling down my answer --
shame on me. But I did get the 7 George wanted for an answer :-)

Blame it on HP's somewhat upsetting news this week :-(

Regards,
JWP

> -----Original Message-----
> From:	Whittall, Conrad [SMTP:Conrad.Whittall@Cognos.COM]
> Sent:	Friday, November 16, 2001 3:17 PM
> To:	'powerh-l@lists.swau.edu'
> Cc:	'George_DeWolf@midhosp.org'
> Subject:	RE: Is there is simple way in QUIZ to find the position of
> the la st embedded space in a character string?
> 
> 
> 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.
> 
> = = = = = = = = = = = = = = = = = = = = = = = = = = = =
>