<html>
<head>
<Title>Compare Files / Output Changes</Title>
<HTA:APPLICATION
APPLICATIONNAME="File2Compare"
ID="File2Compare"
BORDER="dialog"
INNERBORDER="no"
MAXIMIZEBUTTON="no"
SCROLL="no"
VERSION="1.0"/>
<style type="text/css">
input,button
{
border:1px solid #FF6A22;
background-color:lightblue;
font-family:Courier;
font-size:16px;
color:#0000DD;
font-weight:;
}
textarea{background-color:lightgray;
Color:black;}
body {
overflow:auto;
position:relative;
top:5px;
left:5px;
scrollbar-face-color: #DEE3E7;
scrollbar-highlight-color: #FFFFFF;
scrollbar-shadow-color: #DEE3E7;
scrollbar-3dlight-color: #D1D7DC;
scrollbar-arrow-color: #006699;
scrollbar-track-color: #EFEFEF;
scrollbar-darkshadow-color: #98AAB1;
background-color:black;
margin-top:6px;
color:none;
filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr='lightblue', EndColorStr='blue');
}
button {
border:18px solid #0000DD;
background-color:#0000DD;
font-family:Verdana;
font-size:18px;
height:16px;
font-weight:bold;
cursor:hand; }
div.forumline {margin-left:10px; background-color: black; border: 4px #006699 solid; float:left;
height:600px; width:650px; overflow:scroll; }
div.form {float:left;font-family:Arial;}
div.toolbar {width:145%; font-family:Arial;}
th,td,p { font-family: Verdana, Arial, Helvetica, sans-serif }
hr { height: 8px; border: solid #D1D7DC 8px; border-top-width: 1px;}
.gen { font-size : 16px; }
.genmed { font-size : 16px; }
.gensmall { font-size : 16px; }
.gen,.genmed,.gensmall { color : #000000; }
a.gen,a.genmed,a.gensmall { color: #006699; text-decoration: none; }
a.gen:hover,a.genmed:hover,a.gensmall:hover { color: #DD6900; text-decoration: underline; }
input.button { background-color : #0000DD;
color : #000000; cursor:hand;
font-size: 12px; font-family: Verdana, Arial, Helvetica, sans-serif; }
input.longbt { background-color : #0000DD;
color : #000000;
font-size: 12px; font-family: Verdana, Arial, Helvetica, sans-serif; width:140px}
.code { font-family: Courier, 'Courier New', sans-serif; font-size: 11px; color: #006600;
background-color: #FAFAFA; border: #D1D7DC; border-style: solid;
border-left-width: 1px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px }
.quote {font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 11px; color: #444444; line-height: 145%;
background-color: #FAFAFA; border: #D1D7DC; border-style: solid;
border-left-width: 1px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px }
.err{color: white; background-color: black; font-family: Verdana, Arial, Helvetica, sans-serif }
#FolderPath{color:#FF0000}
</style>
</head>
<script language="VBScript">
Function File2Compare(strFile)
Const ForReading = 1, ForWriting = 2
Dim objFSO,objSourceFile,objSourceFile2
Dim intLineNum, intLineNum2
Title ="File to Compare"
strSearch = "(Tool Head DOWN)"
strAdd = "N0109 (Park Tool)" & vbCrLf _
& "N0110 G01 F999.900" & vbCrLf _
& "N0111 X-1.5 Y1.5 Z-2.82"
strFile = "C:\scripts\test.txt"
Set objFSO = CreateObject("Scripting.FileSystemObject")
If objFSO.FileExists(strFile) Then
Set objFile = objFSO.OpenTextFile(strFile, 1)
Do Until objFile.AtEndOfStream
strLine = objFile.ReadLine
If InStr(strLine, strSearch) Then
strLine = strLine & vbCrLf & strAdd
End If
strNewtext = strNewtext & strLine & vbCrLf
Loop
objFile.Close
Set objFile = objFSO.OpenTextFile(strFile, 2)
objFile.Write strNewtext
objFile.Close
MsgBox "File has been updated: " & strFile, vbInformation
End If
End Function
Sub Window_OnLoad
CenterWindow 820, 680
End Sub
Sub CenterWindow(x,y)
window.resizeTo x, y
iLeft = window.screen.availWidth/2 - x/2
itop = window.screen.availHeight/2 - y/2
window.moveTo ileft, itop
End Sub
Sub OnClickButtonOK()
window.Close
End Sub
Sub OnClickButtonCancel()
window.Close
End Sub
</script>
<center>
<FONT face="Courier" color="black" size=2>Compare File #1:</FONT><input type="file" size="45" name="file1" id="file1" /><br>
<FONT face="Courier" color="black" size=2>Compare File #2:</FONT><input type="file" size="45" name="file2" id="file2" /><br>
<FONT face="Courier" color="black" size=2>Results of Comparison:</FONT><br/>
<textarea id="txtBody" rows="23" cols="65"></textarea><br><br>
<input type="button" style="width:165;height:65" name="OK" id="OK" value="COMPARE FILES" onclick="strFile">
<input type="button" style="width:165;height:65" name="Cancel" id="Cancel" value="EXIT PROGRAM" onclick="OnClickButtonCancel">
</td></tr>
</table>
</table>
</body>
</html>