searchresult Posted May 6, 2007 Share Posted May 6, 2007 When I run this script below often happens that it will print it twice or more times and don't know what is wrong. Case $Button1 $print = _FilePrint("Print.txt") $line = GUICtrlRead($List1) $file = FileOpen("Print.txt", 1) FileWrite("Print.txt", "Bijeli Delfin d.o.o."& @Crlf) FileWrite("Print.txt", "Adresa lokala"&@Crlf) FileWrite("Print.txt", "Broj računa: ") _DateTimeSplit($vrijeme,$MyDate,$MyTime) For $x = 1 to $MyDate[0] FileWrite("Print.txt",$MyDate[$x]) Next For $x = 1 to $MyTime[0] FileWrite("Print.txt",$MyTime[$x]) Next FileWrite("Print.txt", @crlf &@crlf) FileWrite($file, $Line) $print = _FilePrint("Print.txt") If $print Then MsgBox(64, "Račun", "Račun je ispisan.") Else MsgBox(48, "Račun", "Greka: " & @error & @CRLF & "Račun nije ispisan.") EndIf FileClose(FileOpen("E:\sustav naplate\forma\Print.txt", 2)) Link to comment Share on other sites More sharing options...
PsaltyDS Posted May 7, 2007 Share Posted May 7, 2007 I don't see why it wouldn't print twice: You print the file on line 4 of the above code, then write some stuff to the file, then print it again on line 21. Why wouldn't it print twice? Maybe line 4 should be commented out? Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
searchresult Posted May 7, 2007 Author Share Posted May 7, 2007 I don't see why it wouldn't print twice: You print the file on line 4 of the above code, then write some stuff to the file, then print it again on line 21. Why wouldn't it print twice? Maybe line 4 should be commented out? I have seen the error what I have made... Thanks for pointing it out.Please delete this topic... Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now