NetXMS Support Forum

English Support => General Support => Topic started by: colaboy on August 12, 2010, 06:43:54 AM

Title: String function in NXSL
Post by: colaboy on August 12, 2010, 06:43:54 AM
Hi, is that any function in NXSL like index() and rindex()?  I need to know the location before I use substr().

Thank you.
Title: Re: String function in NXSL
Post by: Victor Kirhenshtein on August 12, 2010, 10:45:56 AM
Hi!

There are no such functions in current version. I have implemented index and rindex for next version. If you need them urgently, I can publish source code patch or rebuilt NXSL engine for Windows.

Best regards,
Victor
Title: Re: String function in NXSL
Post by: colaboy on August 12, 2010, 12:55:20 PM
 :D Great~ I am using windows version, really appreciate if you can rebuild it.
Title: Re: String function in NXSL
Post by: Victor Kirhenshtein on August 12, 2010, 09:06:06 PM
Here it is. Just replace existing libnxsl.dll with attached one.

Short description of new functions:

index(string, substring, [position])
Returns the position of the first occurrence of SUBSTRING in STRING at or after POSITION.
If you don't specify POSITION, the search starts at the beginning of STRING. If SUBSTRING
is not found, returns 0.

rindex(string, substring, [position])
Returns the position of the last occurrence of SUBSTRING in STRING at or before POSITION.
If you don't specify POSITION, the search starts at the end of STRING. If SUBSTRING
is not found, returns 0.

All indexes are 1-based (first character has index 1), as in substr.

Best regards,
Victor
Title: Re: String function in NXSL
Post by: colaboy on August 13, 2010, 07:18:10 AM
 :D It works~!

I noticed that the 1.05 User Manual is out, hope to see the new version soon~