Is there anyway in TestComplete to have the Files.Compare routine return the number of differences found in a file rather than a simple boolean. The reason for this is that the file that I wish to compare includes the version number of the AUT and the creation date. Thus I only want to flag a comparison failure if the number of differences is greater than two, not greater than zero.
The only way that I can do this at present is to write a subroutine to strip the offending lines out of the file prior to comparison, which is a bit awkward to generalise.
According to the Help, in the section Comparing Files, there is a tolerance level that you can set as the third value of the Files.Compare. You get the value for that third parameter by taking two files that have the AUT and Date different, and run it through this function.
</font><blockquote><font size="1" face="Verdana, Arial, Helvetica">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">var FileName, Hash;
FileName = Files.NameByFileName("C:\\Work\\OrdersList_ol d.txt"
Hash = Files.CalculateHashValue(FileName, "C:\\Work\\OrderList.txt"</pre><hr /></blockquote><font size="2" face="Verdana, Arial, Helvetica">I am not sure if this will Hash out to a 2, so I would suggest doing the run and letting us know what number it returns.
Software Test Engineer
If builders built buildings the way programmers wrote programs, then the first woodpecker that came along would destroy civilization.