[Lazarus] FPC 2.2.2 - Lazreport samples EPropertyError
cc_ at freemail.hu
cc_ at freemail.hu
Tue Aug 12 08:37:40 CEST 2008
Hi,
I have been using the following code to write data to a serial printer:
var ser:TBlockSerial;
buf:string;
begin
ser:=TBlockserial.Create;
try
ser.RaiseExcept:=True;
ser.Connect(cashdrawer);
ser.Config(9600,8,'N',0,false,false);
ser.SendString(buf);
ser.Flush;
finally
ser.Free;
end;
end;
However, if I use this nothing gets sent to the printer.
But if I place
showmessage('Printed!');
after the ser.SendString(but) then it prints out as expected.
Is there any way to get the program to pause before it frees up the
TSerial object? It's a bit of a pain having to click the okay button
of the Showmessage() all the time....
More information about the Lazarus
mailing list