you should use the [Code][/code] tags when posting code. to keep the layout and readability.
then looking at your code:
Case $line="$line"
If (WriteLine(2, $line <>0)
this is obviously what you have intended as for other cases. well, it isn't.
kixtart needs to process your "$line", that is insert the line inside text.
after that, it needs to compare that text with the initial $line. it may or may not be the same.
check from manual what to do in this type of case.
the writeline has an syntax error, missing quote.
a quick re-write of your script would lead me to:
$file="C:\Program Files\Axiohm\cfgDL01.txt"
$file2="C:\Program Files\Axiohm\cfgDL01.new"
if not Exist ($file)
"no file to edit, quitting..."
sleep 2
Quit
EndIf
if Exist ($file2) ;we want the new to be clean.
del $file2
EndIf
If Open(1,$file)
"can't open file for reading, quitting..."
sleep 2
Quit
EndIf
If Open(2,$file2,5)
"can't open file for writing, quitting..."
sleep 2
Quit
EndIf
$line=ReadLine(1)
While @error = 0
Select
Case $line="MYID , ID"
$rc=WriteLine(2,"MYID , " + @wksta + @crlf)
Case "others"
$rc=WriteLine(2,$line + @crlf)
EndSelect
$line=ReadLine(1)
Loop
$rc=Close(1)
$rc=Close(2) |
_________________________
!download
KiXnet