lazbarcodes: Pascalized function in_alpha in lbc_qr.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@8238 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2022-03-28 13:20:15 +00:00
parent 4801b18d59
commit f75afb789d

View File

@ -258,33 +258,12 @@ hexagon: array [0..119] of integer = (
const SSET='0123456789ABCDEF';
*)
function in_alpha(glyph: Integer): Integer;
function in_alpha(glyph: Integer): Boolean;
var
retval: Integer = 0;
cglyph: Char;
begin
{INITCODE} retval := 0;
{INITCODE} cglyph := Char (glyph);
if IsTrue(((cglyph >= '0')) and ((cglyph <= '9'))) then
begin
retval := 1;
end;
if IsTrue(((cglyph >= 'A')) and ((cglyph <= 'Z'))) then
begin
retval := 1;
end;
case cglyph of
' ',
'$',
'%',
'*',
'+',
'-',
'.',
'/',
':': retval := 1;
end;
exit (retval);
cglyph := Char(glyph);
Result := cglyph in ['0'..'9', 'A'..'Z', ' ', '$', '%', '*', '+', '-', '.', '/', ':'];
end;
procedure define_mode(mode: PChar; jisdata: PInteger; length: Integer; gs1: Boolean);
@ -301,7 +280,7 @@ begin
mode[i] := 'K';
end else begin
mode[i] := 'B';
if IsTrue(in_alpha (jisdata[i])) then
if in_alpha(jisdata[i]) then
begin
mode[i] := 'A';
end;
@ -3229,7 +3208,7 @@ begin
begin
Inc (n_count);
end;
if IsTrue(in_alpha (jisdata[i])) then
if in_alpha(jisdata[i]) then
begin
Inc (a_count);
end;