• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 172
  • Last Modified:

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];
     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);

Open in new window

2 Solutions
Todd MummertCommented:

try using  ansichar()  instead of chr()

For more on this, see here:



var buff:string[4];

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.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now