Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: Directive for AnsiStrings?


This question is answered. Helpful answers available: 1. Correct answers available: 1.


Permlink Replies: 3 - Last Post: Jan 28, 2017 11:53 AM Last Post By: Jeff Overcash (...
Andrea Kaiser

Posts: 63
Registered: 11/17/15
Directive for AnsiStrings?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jan 27, 2017 2:59 PM
I have an old Delphi 7 unit that I would like to include in my project. (I will rebuild it later, but for now I'd just like to embed it.)
Is there a compiler directive to omit Unicode only for this unit? Like a compatibility mode?

I didn't find anything on this list: http://docs.embarcadero.com/products/rad_studio/delphiAndcpp2009/HelpUpdate2/EN/html/devcommon/delphicompdirectivespart_xml.html
Jeff Overcash (...

Posts: 1,529
Registered: 9/23/99
Re: Directive for AnsiStrings?
Helpful
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jan 27, 2017 10:40 PM   in response to: Andrea Kaiser in response to: Andrea Kaiser
Andrea Kaiser wrote:
I have an old Delphi 7 unit that I would like to include in my project. (I will rebuild it later, but for now I'd just like to embed it.)
Is there a compiler directive to omit Unicode only for this unit? Like a compatibility mode?

I didn't find anything on this list: http://docs.embarcadero.com/products/rad_studio/delphiAndcpp2009/HelpUpdate2/EN/html/devcommon/delphicompdirectivespart_xml.html

No PChar and String are Unicode types since D2009. Odds are your unit compiles
just fine for UniCode unless you are doing strange things like storing non
string data in your string type.

--
Jeff Overcash (TeamB)
(Please do not email me directly unless asked. Thank You)
Learning is finding out what you already know. Doing is demonstrating that you
know it. Teaching is reminding others that they know it as well as you. We are
all leaners, doers, teachers. (R Bach)
Andrea Kaiser

Posts: 63
Registered: 11/17/15
Re: Directive for AnsiStrings?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jan 28, 2017 12:00 AM   in response to: Jeff Overcash (... in response to: Jeff Overcash (...
Jeff Overcash (TeamB) wrote:
Andrea Kaiser wrote:
I have an old Delphi 7 unit that I would like to include in my project. (I will rebuild it later, but for now I'd just like to embed it.)
Is there a compiler directive to omit Unicode only for this unit? Like a compatibility mode?

I didn't find anything on this list: http://docs.embarcadero.com/products/rad_studio/delphiAndcpp2009/HelpUpdate2/EN/html/devcommon/delphicompdirectivespart_xml.html

No PChar and String are Unicode types since D2009. Odds are your unit compiles
just fine for UniCode unless you are doing strange things like storing non
string data in your string type.

--
Jeff Overcash (TeamB)
(Please do not email me directly unless asked. Thank You)
Learning is finding out what you already know. Doing is demonstrating that you
know it. Teaching is reminding others that they know it as well as you. We are
all leaners, doers, teachers. (R Bach)

Yes, I'm doing rather strange things in this unit. :-)
I might be okay just replacing 'string' by 'AnsiString' and so on.

Thanks for the help, Jeff.
Jeff Overcash (...

Posts: 1,529
Registered: 9/23/99
Re: Directive for AnsiStrings?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jan 28, 2017 11:53 AM   in response to: Andrea Kaiser in response to: Andrea Kaiser
Andrea Kaiser wrote:
Jeff Overcash (TeamB) wrote:
Andrea Kaiser wrote:
I have an old Delphi 7 unit that I would like to include in my project. (I will rebuild it later, but for now I'd just like to embed it.)
Is there a compiler directive to omit Unicode only for this unit? Like a compatibility mode?

I didn't find anything on this list: http://docs.embarcadero.com/products/rad_studio/delphiAndcpp2009/HelpUpdate2/EN/html/devcommon/delphicompdirectivespart_xml.html
No PChar and String are Unicode types since D2009. Odds are your unit compiles
just fine for UniCode unless you are doing strange things like storing non
string data in your string type.

--
Jeff Overcash (TeamB)
(Please do not email me directly unless asked. Thank You)
Learning is finding out what you already know. Doing is demonstrating that you
know it. Teaching is reminding others that they know it as well as you. We are
all leaners, doers, teachers. (R Bach)

Yes, I'm doing rather strange things in this unit. :-)
I might be okay just replacing 'string' by 'AnsiString' and so on.

Thanks for the help, Jeff.

Then that is the correct way to go. Or really replacing string with TBytes
which is really what you are using, not a strong.

--
Jeff Overcash (TeamB)
(Please do not email me directly unless asked. Thank You)
Learning is finding out what you already know. Doing is demonstrating that you
know it. Teaching is reminding others that they know it as well as you. We are
all leaners, doers, teachers. (R Bach)
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02