following error happened and I dont know why?

Hi the following error happened and I dont know why?

anyway of converting or anything

[DCC Error] MySQL.pas(2228): E2010 Incompatible types: 'AnsiChar' and 'Char'
function mysql_kill(mysql:PMysql;pid:longint):longint;
var buff:string[3];
begin
     buff[0]:=chr(pid AND $FF);//<-----------------ERROR-----------------
     buff[1]:=chr((pid shr 8) AND $FF);
     buff[2]:=chr((pid shr 16) AND $FF);
     buff[3]:=chr((pid shr 24) AND $FF);
     result:=simple_command(mysql,COM_PROCESS_KILL,@buff,4,false);
end;

Open in new window

LVL 5
eNarcAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Todd MummertCommented:


try using  ansichar()  instead of chr()

For more on this, see here:

https://forums.codegear.com/message.jspa?messageID=65050

and

var buff:string[4];

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
MerijnBSr. Software EngineerCommented:
var buff: string[4] is not necessary. This is some freaky abuse of strings though :p
If you allocate a string[3], it's 1-based. String[0] is used to note the length of the total, so there is actually a 4th byte available.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Delphi

From novice to tech pro — start learning today.