 |
SoftTree Technologies
Technical Support Forums
|
|
Author |
Message |
jambai
Joined: 14 Feb 2013 Posts: 22 Country: United States |
|
How to Scan a file for error |
|
How to scan a file for errors?
I am getting "Line 5: Error opening file for reading error".
 |
 |
Dim FileContent, string
Dim position, number
Dim FilePath, string "E:\\Log1.txt"
FileOpen (FilePath,"StreamMode","Read","Append",position)
FileReadAll(FilePath,FileContent)
Lower(FileContent, FileContent)
Pos (FileContent, "error", 1, position)
IsGreater (position, 0, err_found)
If (err_found, NOTIFY, END)
NOTIFY:
//mailsend
END:
//DONE
|
Thanks
Thanks
|
|
Tue Dec 30, 2014 8:57 pm |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7948
|
|
|
|
Hi if you use FileReadAll, you don't need to open the file for low level level operations. FileReadAll loads the entire file contents into specified variable in one go. Yet, what you are trying to do can
 |
 |
Dim position, number
Dim FileContent, string
FileReadAll("E:\\Log1.txt", FileContent)
Lower(FileContent, FileContent)
Pos (FileContent, "error", 1, position)
IsGreater (position, 0, err_found)
If (err_found, NOTIFY, END)
NOTIFY:
//mailsend
END:
//DONE |
|
|
Tue Jan 06, 2015 10:24 am |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|