Convert Delphi 7 code to work with Delphi 2009

Posted by Brad on Stack Overflow See other posts from Stack Overflow or by Brad
Published on 2010-05-09T19:55:10Z Indexed on 2010/05/09 19:58 UTC
Read the original article Hit count: 1262

Filed under:
|

I have a String that I needed access to the first character of, so I used stringname[1]. With the unicode support this no longer works. I get an error: [DCC Error] sndkey32.pas(420): E2010 Incompatible types: 'Char' and 'AnsiChar'

Example code: //vkKeyScan from the windows unit

var KeyString: string; MKey : Word;

mkey:=vkKeyScan(KeyString[1])

How would I write this in modern versions of Delphi

Thanks

-Brad

© Stack Overflow or respective owner

Related posts about delphi-2009

Related posts about delphi-2010