Page 1 of 1 1
Topic Options
#192072 - 2009-02-05 05:34 PM Does Substr Neg offset work?
n1st Offline
Fresh Scripter

Registered: 2006-06-08
Posts: 14
Does this work for anyone? I would think it should display "c".

? substr("abc", -1, 1)

Top
#192073 - 2009-02-05 05:41 PM Re: Does Substr Neg offset work? [Re: n1st]
Allen Administrator Offline
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4567
Loc: USA
Left and Right work that way, but I don't think substr does.
Top
#192074 - 2009-02-05 06:00 PM Re: Does Substr Neg offset work? [Re: Allen]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4402
Loc: New Jersey
Right('abc', 1) ?
actually.. but not substring.

Glenn
_________________________
Actually I am a Rocket Scientist! \:D

Top
#192075 - 2009-02-05 06:50 PM Re: Does Substr Neg offset work? [Re: Glenn Barnas]
n1st Offline
Fresh Scripter

Registered: 2006-06-08
Posts: 14
Thanks.
Top
#192080 - 2009-02-05 09:04 PM Re: Does Substr Neg offset work? [Re: n1st]
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11631
Loc: CA
Sure it works. Not intuitive if you don't know what is at that location but it works.

$RC = SubStr("abc", 3, 1)
'RC is: ' + $RC

Top
#192084 - 2009-02-05 10:20 PM Re: Does Substr Neg offset work? [Re: NTDOC]
Allen Administrator Offline
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4567
Loc: USA
He asked if substr can accept negative numbers, like what left and right supports.
Top
#192085 - 2009-02-05 10:21 PM Re: Does Substr Neg offset work? [Re: NTDOC]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
doc?

I think he asked if reversivesubstring (with that -1) works.
it doesn't. shouldn't. not a feature.

could be though...
_________________________
!

download KiXnet

Top
#192090 - 2009-02-06 09:23 AM Re: Does Substr Neg offset work? [Re: Lonkero]
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
I wrote a replacement ufdSubStr() a looong time ago to provide support for negative paramaters. It might even have preceded LEFT() and RIGHT().

udfSubStr()

That 9 year maximum on searches is beginning to look like it might be a problem soon!

Top
#192092 - 2009-02-06 04:06 PM Re: Does Substr Neg offset work? [Re: Richard H.]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
well, yeah.
any search on 3.xx is out already.
for 4.0x reliable results it will start to affect within a year or two.
_________________________
!

download KiXnet

Top
#192105 - 2009-02-06 09:21 PM Re: Does Substr Neg offset work? [Re: Lonkero]
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11631
Loc: CA
Well the next version of the board software is supposed to remove that hard coded limit. I've been putting off upgrading the board though because the new security management is a BIG change and many that have upgraded had to spend a lot of extra time making the board work properly again they way they were used to. It's a good thing overall because it gives much more granular control, but a lot more to review and make sure you have it right as well.

That and the board has not been very busy lately either.

But who knows... maybe I'll update it when the next big update comes out.

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 484 anonymous users online.
Newest Members
Sir_Barrington, batdk82, StuTheCoder, M_Moore, BeeEm
17886 Registered Users

Generated in 0.094 seconds in which 0.058 seconds were spent on a total of 13 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org