Errors "Illegal type conversion" lazarus / 9-Editor ---------------------------------------------------------------------- Vlad1997 · 2009-11-06 08:57 Errors "Illegal type conversion: "longint" to """ : Code: [Select]rgbc = record //color in RGB    r:byte;    g:byte;    b:byte; end; procedure TForm2.ctrgb(c:integer;var r,g,b:byte); //procedure for translate color to RGB begin  r:=rgbc(c).r; //error  g:=rgbc(c).g; //error  b:=rgbc(c).b; //error end; function TForm2.rgbtc(r,g,b:byte):integer; //function for translate RGB to color begin  rgbc(Result).r:=r; //error  rgbc(Result).g:=g; //error  rgbc(Result).b:=b; //error end; Everywhere the same errors. In Delphi it worked, in Lazarus - isn't working (Ubuntu 9.10). How to fix these errors? ---------------------------------------------------------------------- theo · 2009-11-06 09:52 Are you sure that this works in delphi? They don't even have the same size: integer 32bit, your record 24bit. It works if you define the record with the same size: rgbc = record //color in RGB    r:byte;    g:byte;    b:byte;    a:byte; end; ---------------------------------------------------------------------- Vlad1997 · 2009-11-06 10:14 Thank you) And what is "a"? Alpha? ---------------------------------------------------------------------- theo · 2009-11-06 10:17 Quote from: Vlad1997 on November 06, 2009, 11:14:12 amAnd what is "a"? Alpha? Whatever, could be Alpha, or if you only need 24bit "dummy", "reserved".... ---------------------------------------------------------------------- Vlad1997 · 2009-11-06 10:30 And how to do RGBA-format? The fourth option is doing something strange... if it is zero, then everything is normal, while the other makes the black and white shades, with a strange sequence of...