summaryrefslogtreecommitdiff
path: root/fpcsrc/tests/tbs/tb0022.pp
blob: bd23b1bae815000674f1c7f21bfd4c4b2f0e848e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
{ Old file: tbs0026.pp }
{  tests for a wrong unused. var. warning              OK 0.9.4 }

const
  HexTbl : array[0..15] of char=('0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F');
function HexB(b:byte):string;
begin
  HexB[0]:=#2;
  HexB[1]:=HexTbl[b shr 4];
  HexB[2]:=HexTbl[b and $f];
end;



function HexW(w:word):string;
begin
  HexW:=HexB(w shr 8)+HexB(w and $ff);
end;



begin
  HexW($fff);
end.