filestrseek

Forward searchs a string from a file.

filestrseek <file handle> <string>

Remarks

Searches for <string> in the file specified by <file handle>.
The search is done forward and started from the current position of the file pointer. For the backward search, use the "filestrseek2" command.
If <string> is found, the file pointer is moved to the next character of the string and the system variable "result" is set to 1.
If <string> is not found, the file pointer is not moved and "result" is set to zero.

Example

fileopen fhandle 'teraterm.log' 0

; Search for the string "abc" in the file "teraterm.log".
filestrseek fhandle 'abc'
if result=0 goto not_found
; Read characters from the next of "abc" to the end of the line.
filereadln fhandle str

:not_found
fileclose fhandle