View Issue Details

IDProjectCategoryView StatusLast Update
0027869LazarusPrinterpublic2015-04-20 07:57
ReporterLacaKAssigned ToJesus Reyes 
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product Version1.2.6Product Build 
Target Version1.6Fixed in Version1.5 (SVN) 
Summary0027869: Add convenience method TPrinter.Write(const S: AnsiString): Boolean; overload;
DescriptionWhen working with dot-matrix printers or barcode printers, then we often need send string data to printer in raw mode.
Now I use class helper for TPrinter where I declare new method for write string.
It will be nice have it in TPrinter in printers.pas

Something like:

function TPrinter.Write(const S: AnsiString): Boolean; overload;
var Len, Written: integer;
begin
  Len := Length(S);
  Result := Write(S[1], Len, Written) and (Written=Len);
end;
Additional InformationFor now I use something like this:

type
  TPrinterHelper = class helper for TPrinter
    public
      procedure WriteLn(const s: string);
  end;

procedure TPrinterHelper.WriteLn(const s: string);
var Written: integer;
begin
  Write(s[1], length(s), Written);
end;
TagsNo tags attached.
Fixed in Revision48770
LazTarget1.6
WidgetsetWin32/Win64
Attached Files

Activities

LacaK

2015-04-16 07:45

developer   ~0082943

Or simply:

function TPrinter.Write(const S: AnsiString): Boolean; overload;
var Written: integer;
begin
  Result := Write(S[1], Length(S), Written);
end;

Jesus Reyes

2015-04-17 19:39

developer   ~0083017

Added

LacaK

2015-04-20 07:57

developer   ~0083058

Thanks

Issue History

Date Modified Username Field Change
2015-04-16 07:34 LacaK New Issue
2015-04-16 07:45 LacaK Note Added: 0082943
2015-04-17 09:23 Jesus Reyes Assigned To => Jesus Reyes
2015-04-17 09:23 Jesus Reyes Status new => assigned
2015-04-17 19:39 Jesus Reyes Fixed in Revision => 48770
2015-04-17 19:39 Jesus Reyes LazTarget => 1.6
2015-04-17 19:39 Jesus Reyes Note Added: 0083017
2015-04-17 19:39 Jesus Reyes Status assigned => resolved
2015-04-17 19:39 Jesus Reyes Fixed in Version => 1.5 (SVN)
2015-04-17 19:39 Jesus Reyes Resolution open => fixed
2015-04-17 19:39 Jesus Reyes Target Version => 1.6
2015-04-20 07:57 LacaK Note Added: 0083058
2015-04-20 07:57 LacaK Status resolved => closed