Forum Discussion
rrubio
15 years agoContributor
Hi all,
I have tried to migrate this code to VisualBasic.
However, I do have an error when opening the file (error -1072896636).
Does anybody know which the cause could be?
I attach the code I have done:
Function GetSum(sType)
Dim tempFolder, xDoc, wrnC, errC
tempFolder = aqEnvironment.GetEnvironmentVariable("temp") & "\" & IntToStr(10000) & "\"
aqFileSystem.CreateFolder(tempFolder)
Call Log.SaveResultsAs(tempFolder, lsXML, True)
Set xDoc = Sys.OleObject("MSXML2.DOMDocument.6.0")
Call xDoc.load(tempFolder & "Description.tcLog")
' tested with
' Call xDoc.loadXML(tempFolder & "Description.tcLog")
' and result id the same
Log.Message ("File load result: " & xDoc.parseError.errorCode)
' Warning count
Set wrnC = VarToInteger(xDoc.selectSingleNode("Nodes/Node[@name='root']/Prp[@name='warning count']/@value").text)
' Error count
Set errC = VarToInteger(xDoc.selectSingleNode("Nodes/Node[@name='root']/Prp[@name='error count']/@value").text)
Call aqFileSystem.DeleteFolder(tempFolder, True)
Select Case sType
Case w: result = IntToStr(wrnC)
Case e: result = IntToStr(errC)
Case Else result = "Wrong parameter"
End Select
End Function
I have tested in using .load .loadXML methods.
I have tested again with a static file to be loaded in another path in Windows Explorer.
In all the cases, I get the same error.
Thank you very much,
Raul
I have tried to migrate this code to VisualBasic.
However, I do have an error when opening the file (error -1072896636).
Does anybody know which the cause could be?
I attach the code I have done:
Function GetSum(sType)
Dim tempFolder, xDoc, wrnC, errC
tempFolder = aqEnvironment.GetEnvironmentVariable("temp") & "\" & IntToStr(10000) & "\"
aqFileSystem.CreateFolder(tempFolder)
Call Log.SaveResultsAs(tempFolder, lsXML, True)
Set xDoc = Sys.OleObject("MSXML2.DOMDocument.6.0")
Call xDoc.load(tempFolder & "Description.tcLog")
' tested with
' Call xDoc.loadXML(tempFolder & "Description.tcLog")
' and result id the same
Log.Message ("File load result: " & xDoc.parseError.errorCode)
' Warning count
Set wrnC = VarToInteger(xDoc.selectSingleNode("Nodes/Node[@name='root']/Prp[@name='warning count']/@value").text)
' Error count
Set errC = VarToInteger(xDoc.selectSingleNode("Nodes/Node[@name='root']/Prp[@name='error count']/@value").text)
Call aqFileSystem.DeleteFolder(tempFolder, True)
Select Case sType
Case w: result = IntToStr(wrnC)
Case e: result = IntToStr(errC)
Case Else result = "Wrong parameter"
End Select
End Function
I have tested in using .load .loadXML methods.
I have tested again with a static file to be loaded in another path in Windows Explorer.
In all the cases, I get the same error.
Thank you very much,
Raul