I just add a small program to illustrate the type cast between signed and unsigned:

var
   si: ShortInt;
begin
     si:= -127;
     WriteLn( 'si ', si);
     WriteLn( 'Byte(si) ', Byte(si));
     si:= -1;
     WriteLn( 'si ', si);
     WriteLn( 'Byte(si) ', Byte(si));
end.

gives

$ ./project1
si -127
Byte(si) 129
si -1
Byte(si) 255
$



_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to