pascal kerdes

Fuzesi Arnold arnold.fuzesi.lista at gmail.com
Mon Sep 17 19:36:42 CEST 2007


sajna azt se tudja megmondani mibaja...
csak vmit rinyál és kész.

amugy a bray fele terminal-nak a script része

ezt pl tudja :), ez a sample:


const STRING1 = 'first test';

var i: longint;
begin
  writeln(STRING1);
  comsendstr(STRING1);
  while not(i=27) do // wait for ESC char
  begin
    i:=0;
    while i=0 do i:=ComReadChr();
      if (i=ord('1')) then writeln('Test 1...');
      if (i=ord('2')) then writeln('Test 2...');
      if (i=ord('3')) then writeln('Test 3...');
  end;
  writeln('while loop exit');

  // send alphabet
  for i:=65 to 90 do
  begin
    comsendchr(i);
  end;
end.


----- Original Message ----- 
From: "Info" <info at kiralyelektronika.hu>
To: "Fuzesi Arnold" <elektro at tesla.hu>
Sent: Monday, September 17, 2007 8:29 PM
Subject: Re: pascal kerdes


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;

-----------------------------------------
          elektro[-flame|-etc] 



More information about the Elektro mailing list