pascal kerdes

Info info at kiralyelektronika.hu
Mon Sep 17 20:29:39 CEST 2007


Szia !

> bocs, azt elfelejtettem hogy hexaban kellene kiírni.
> szoval ez jön pl be @@@@@@<4F>@@@@@@<4F>
> akkor ez kellene ki:
> 40 40 40 40 40 40 4F 40 40 40 40 40 40 4F

Jahogy befele bájtok és kiírni karakterekben ? :) Ok.
Ehez tudni kéne mit tud az interpretered...

const
 Hex: aray[0..15]of Char = ('0', '1', '2', '3', '4', '5', '6', '7',
 '8', '9', 'A', 'B', 'C', 'D', 'E', 'F');
 
var
 ch:  Char;

........
while true do begin
  ch := ComReadChr();
  if ch = $4F then
    WriteLn( Hex[Ord(ch) shr 4] + Hex[Ord(ch) and $0F] )
  else
    Write( Hex[Ord(ch) shr 4] + Hex[Ord(ch) and $0F] );
end;



More information about the Elektro mailing list