[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index] [Date Index] [Thread Index]
[SQR-USERS Info] [SQRUG Home Page]

RE: [sqr-users] RAT in sqr - search char string for first pos of charstarting from the right?



Paul,

STRRCHR will return a 0 if the character is not found otherwise the
offset into the string.

Begin-Report
 Let $String = 'c:\dir1\dir2\file.txt'
 Do STRRCHR($String, '\', #Offset)
 Show #Offset
End-Report

Begin-Procedure STRRCHR($String, $Char, :#Offset)
 Let #OffSet = Instr(Edit($String, 'R'), $Char, 0)
 If (#Offset)
  Let #Offset = Length($String)-#Offset+1
 End-If
End-Procedure 

Peter

-----Original Message-----
From: sqr-users-bounces+peter_burton=hyperion.com@sqrug.org
[mailto:sqr-users-bounces+peter_burton=hyperion.com@sqrug.org] On Behalf
Of Paul Delange
Sent: Wednesday, February 22, 2006 5:29 PM
To: sqr-users@sqrug.org
Subject: [sqr-users] RAT in sqr - search char string for first pos of
char starting from the right?


Hi All,

How do I search a char string for the first occurance of a character
going
from right to left?

Example

c:\dir1\dir2\file.txt

How do I find the position of the THIRD \ (answer would be 12).

Thanks, Paul


_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users


If you have received this e-mail in error, please delete it and notify the 
sender as soon as possible. The contents of this e-mail may be confidential and 
the unauthorized use, copying, or dissemination of it and any attachments to 
it, is prohibited.

Internet communications are not secure and Hyperion does not, therefore, accept 
legal responsibility for the contents of this message nor for any damage caused 
by viruses. The views expressed here do not necessarily represent those of 
Hyperion.

For more information about Hyperion, please visit our Web site at 
www.hyperion.com



_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users