Hi,
i have an error with the code below:(I use lazarus last version on windows 10 x64)
procedure textcolor(color : byte);
begin
_putch(CSI);
_putch(BRACKET);
if (color and $8) then <= error: incompatibles types: got "Byte" expected "Boolean"
_putch($31)
else _putch($32);
_putch($6D);
_putch(CSI);
_putch(BRACKET);
_putch($33);
_putch(((color and $7) mod 10)+'0');
_putch($6D);
end;
Equivalent to C code that work is:
void textcolor(int color)
{
_putch('\033');
_putch('[');
if (color & 0x8)
_putch('1');
else _putch('2');
_putch('m');
_putch('\033');
_putch('[');
_putch('3');
_putch(((color&0x7)%10)+'0');
_putch('m');
}
for information, _putch is defined as below:
i use lazSerial for sending VT100 on serial.
procedure _putch(data : byte);
begin
ser.SendByte(data);
end;
i don't see the error, the C code wotk fine
thanks for your help