Page 1 of 1

Small bug in doc (function return)

Posted: 16 Apr 2014 11:53
by pjj
For ScriptUtils.RegExPos (and for other similar functions) the doc states:
If nothing is found, the function returns 0 (zero).
In fact it is -1, not 0, as I just learnt:

Code: Select all

for (var i = 0; i < Document.LineCount; i++) {
    x = ScriptUtils.RegExPos("^\\s+", Document.Lines[i], exp);
(I tested with ScriptUtils.RegExPos only, though.)