Forum Discussion
joffre
14 years agoRegular Contributor
Sub Procurar
Path = "D:\Scripts\Logs\Oracle\Ora10g"
s = aqFile.ReadWholeTextFile(Path&"\1-1.txt", aqFile.ctANSI)
s = aqString.Find(s, "Tabela criada")
aqFile.Create(Path&"\LogsFinais\1-1.txt")
If (s <> -1) Then
Call aqFile.WriteToTextFile
Call aqFile.WriteToTextFile(Path&"\LogsFinais\1-1.txt", "Tabelas criadas!", aqFile.ctANSI)
Log.Message("Tabelas criadas!")
Log.Message(s)
Else
Call aqFile.WriteToTextFile(Path&"\LogsFinais\1-1.txt", "Tabelas não criadas!", aqFile.ctANSI)
Log.Error(s)
End If
End Sub
Here is the code I've created. It reads the log file and if the string "Tabela criada" isn't found, my variable "s" will recieve -1 and it will create a log file with the text "Tabelas não criadas" (Tables not created). If my variable "s" doesn't recieve -1 it means that the tables were created, so my log file will be created with the text "Tabelas cradas" (Tables created).
Is that right or I am missing something?