Delphi 2007 to Delphi 2009 Conversion

CharArrayPtr = ^CharArray;
CharArray = array[0..MaxInt-1] of Char;

How to convert to Delphi 2009?

Bill
0
Bill
9/18/2008 1:47:00 PM
📁 embarcadero.delphi.win32
📃 2183 articles.
⭐ 0 followers.

💬 4 Replies
👁️‍🗨️ 2206 Views

Bill Miller wrote:

> CharArrayPtr = ^CharArray;
> CharArray = array[0..MaxInt-1] of Char;
> 
> How to convert to Delphi 2009?
> 
> Bill

it depends heavelly on how it is used fearther down in your project and
what you want to convert it to.

I you want to simple convert the declarations ignoring UNicode
altogether then the only think you have to change is the CharArray
declaratin from a Char to an AnsiChar eg

CharArrayPtr = ^CharArray;
CharArray = array[0..MaxInt-1] of AnsiChar; //----------- this changed

This Shoold be enough that the procedures using it and are expecting
ANSI characters in the string will work with out any changes.

regards
Yannis.
-- 
"The difference between pornography and erotica is lighting."
 -- Gloria Leonard
0
IOANNIS
9/18/2008 2:31:38 PM
> it depends heavelly on how it is used fearther down in your project and
> what you want to convert it to.
>
> I you want to simple convert the declarations ignoring UNicode
> altogether then the only think you have to change is the CharArray
> declaratin from a Char to an AnsiChar eg
>
> CharArrayPtr = ^CharArray;
> CharArray = array[0..MaxInt-1] of AnsiChar; //----------- this changed
>
> This Shoold be enough that the procedures using it and are expecting
> ANSI characters in the string will work with out any changes.


Hi Yannis,

I am trying to maintain the TString type without using Ansi.  I think I 
should try to maintain Unicode capability.   I but am not sure how to handle 
these conversions yet.

Bill
0
Bill
9/18/2008 3:49:29 PM
Bill Miller wrote:

> Hi Yannis,
> 
> I am trying to maintain the TString type without using Ansi.  I think
> I should try to maintain Unicode capability.   I but am not sure how
> to handle these conversions yet.

CharArrayPtr = ^CharArray;
CharArray = array[0..(MaxInt div SizeOf(Char)) - 1] of Char;

This would be the recomended way to declare it I guess. 

regards
Yannis.

-- 
"Only two things are infinite, the universe and human stupidity, 
 and I'm not sure about the former."
 -- Albert Einstein (1879-1955)
0
IOANNIS
9/19/2008 8:18:31 AM
> I am trying to maintain the TString type without using Ansi.  I think I
> should try to maintain Unicode capability.   I but am not sure how to 
> handle
> these conversions yet.

Why without using Ansi ? Seems like trying to make a form, but without using 
buttons :)
0
Raymond
9/19/2008 11:59:52 AM
Reply: