10-15-2014, 05:41 AM
I don't know if it exists or not but in the meantime you could try this:
Function getLineIndex
for testing only:
Macro getLineIndex Test
Function getLineIndex
function ~inputStr #cIndex
str line
int maxLen=0
int charLen=0
int lineIndex=0
foreach line inputStr
,maxLen += line.len-1
;
;Handle case where charIndex is < 0 or > max string length
if (cIndex < 0) or (cIndex > maxLen)
,lineIndex=-1
,goto Done
foreach line inputStr
,charLen += line.len-1
,if(charLen < cIndex) lineIndex+1
,else break
;
;Done
ret lineIndex
for testing only:
Macro getLineIndex Test