Hi,

HB_RAT(cToken, cString, nStart, nEnd) ignores nEnd, if it is "out of bound". I feel is more natural "out of bound" string be an empty string.


Example: I want to iterate over all "/" characters from right to left.
cPath := "/aaa/bbb/ccc"
nI := LEN(cPath)
DO WHILE(nI := HB_RAT("/", cPath,, nI)) > 0
  ? nI
  nI--
ENDIF


But this is endless loop:
9
5
1
9
5
1
...


I would expect HB_RAT("/", cPath,, 0) to search "/" in a empty (zero length) substring of cPath, and thus return 0.


Does anyone has objection against such change?


Regards,
Mindaugas
_______________________________________________
Harbour mailing list
[email protected]
http://lists.harbour-project.org/mailman/listinfo/harbour

Reply via email to