Navigation:  Appendices > Macro Language > Built-in Functions > All Functions (Alphabetical) >


Previous pageReturn to chapter overviewNext page

int = PosNth(nNth,sSubString,sString)


This macro function is similar to Pos, but it returns the Nth occurrence of a sub-string in a string. If the sub-string is present less than N times, then the function returns zero.


PosNth(2,'A','Aardvark') = 0

PosNth(2,'a','Aardvark') = 6

PosNth(1,'a','Art') = Pos('a','Art') = 0


Although PosNth(1,sOne,sTwo) is the same as Pos(sOne,sTwo), the former is slower to execute. Always use Pos instead of PosNth if you can.


See also : Pos.



Topic 108274 updated on 05-Mar-2002.
Topic URL: http://www.qppstudio.net/webhelp/index.html?posnth.htm