SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
How to Scan a file for error

 
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite View previous topic
View next topic
How to Scan a file for error
Author Message
jambai



Joined: 14 Feb 2013
Posts: 22
Country: United States

Post How to Scan a file for error Reply with quote
How to scan a file for errors?
I am getting "Line 5: Error opening file for reading error".

Code:

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 View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7839

Post Reply with quote
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

Code:
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 View user's profile Send private message
Display posts from previous:    
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite All times are GMT - 4 Hours
Page 1 of 1

 
Jump to: 
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


 

 

Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Flowers Online.