Dennis

Thanks for the code, sad to say you are still stretching me with that example.
SRPL still seems much easier in my mind.

I will have to get a strong cup of coffee and study this some more.

Marc




----- Original Message ----- From: "Dennis McGrath" <[email protected]>
To: "RBASE-L Mailing List" <[email protected]>
Sent: Monday, January 12, 2009 2:03 PM
Subject: [RBASE-L] - RE: SRPL limit?


Marc,

You can create your own custom functions for RBase to use.

Not withstanding that, here is some sample code on how work around the SRPL problem. This method works whether your replacement value is null or not



SET VAR vTmp = 'abc' -- original text
SET VAR vFind = 'b' -- Text to find
SET VAR vRepl TEXT = NULL -- text to substitute

SET VAR vPos INTEGER
SET VAR vLen INTEGER
SET VAR vPre TEXT
SET VAR vPost TEXT

SET VAR vPos = (SLOC(.vTmp,.vFind))
IF vPos > 0 THEN
 SET VAR vLen = (SLEN(.vFind))
 SET VAR vPre = (SGET(.vTmp,(.vPos-1),1))
 SET VAR vPost = (SGET(.vTmp,(SLEN(.vTmp)),(.vPos+.vLen)))
 SET VAR vTmp = (.vPre+.vRepl+.vPost)
ENDIF


SHOW V vTmp
RETURN

Dennis McGRath

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of MDRD
Sent: Monday, January 12, 2009 1:37 PM
To: RBASE-L Mailing List
Subject: [RBASE-L] - RE: SRPL limit?

Dennis

You and Larry are talking over my head and give me too much credit.

Marc

----- Original Message ----- From: "Dennis McGrath" <[email protected]>
To: "RBASE-L Mailing List" <[email protected]>
Sent: Monday, January 12, 2009 1:15 PM
Subject: [RBASE-L] - RE: SRPL limit?


I think one of your best bets is to do as Larry suggested and make you own
function (stored procedure) that you can call.

I suspect someone on this list already has such a function written.

Dennis


-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of MDRD
Sent: Monday, January 12, 2009 12:27 PM
To: RBASE-L Mailing List
Subject: [RBASE-L] - RE: SRPL limit?

Dennis

I thought of that but extra spaces would look bad in the paragraph.

It seems I can come up with some strange needs in my APP.

Marc


----- Original Message ----- From: "Dennis McGrath" <[email protected]>
To: "RBASE-L Mailing List" <[email protected]>
Sent: Monday, January 12, 2009 12:16 PM
Subject: [RBASE-L] - RE: SRPL limit?


Bummer,

As far as I can tell, it has worked that way for some time.
It does limit the usefulness of this function quite a lot.

You could change himer to a space but that may not be what you want.

Dennis McGrath


Reply via email to