Could someone tell me what I am doing wrong here. I have a function that takes a line string created by fgets and the script passes this string to my function Process_Info(see below). I need to extract the string from a fixed index location to the end of the line. I am having problems getting the index number of the end of line character (in this case a line feed).
Thank you.
Example:
Part # = 123456 Rev. RA M
Compat Code = 0x00000001
In both cases above, the info returned from Process_Info fuction should be "123456 Rev. RA M" or "0x00000001"; depending on the line I pass down.
func Process_Info : string
param string strLine
integer nEolPos, nLength
string strInfo
strchr strLine 0x0a nEolPos ;Look for the eol
nLength = nEolPos - 15 + 1 ;Length of data
;extracts the string in specified length
substr strInfo strLine 15 nLength
return strInfo
endfunc
Thank you.
Example:
Part # = 123456 Rev. RA M
Compat Code = 0x00000001
In both cases above, the info returned from Process_Info fuction should be "123456 Rev. RA M" or "0x00000001"; depending on the line I pass down.
func Process_Info : string
param string strLine
integer nEolPos, nLength
string strInfo
strchr strLine 0x0a nEolPos ;Look for the eol
nLength = nEolPos - 15 + 1 ;Length of data
;extracts the string in specified length
substr strInfo strLine 15 nLength
return strInfo
endfunc