Jump to content


Photo

Delphi 5 compatibility


  • Please log in to reply
7 replies to this topic

#1 uli

uli
  • Members
  • 26 posts

Posted 07 November 2006 - 11:48 AM

Hi Boki,

currently I'm trying to compile the NextSuite project group in D5 and have some questions and suggestions.

(1) Compiler versions: Could you change NxSuite.inc to include the following:
CODE
// Borland Developer Studio 2006
{$IFDEF VER180}
  {$DEFINE BDS2006}
  {$DEFINE BDS2006_OR_UP}
  {$DEFINE DELPHI7_OR_UP}
  {$DEFINE DELPHI6_OR_UP}
{$ENDIF}

// Delphi 6
{$IFDEF VER150}
  {$DEFINE DELPHI7}
  {$DEFINE DELPHI7_OR_UP}
  {$DEFINE DELPHI6_OR_UP}
{$ENDIF}

// Delphi 6
{$IFDEF VER140}
  {$DEFINE DELPHI6}
  {$DEFINE DELPHI6_OR_UP}
{$ENDIF}

// Delphi 5
{$IFDEF VER130}
  {$DEFINE DELPHI5}
{$ENDIF}

(or just use Mike Lischke's Compiler.inc tongue.gif)

(2) Replace a few occurences of {$IFNDEF DELPHI6} by {$IFDEF DELPHI7_OR_UP}.

(3) You use quite a lot of functionality found in SysUtils, Graphics etc in D6 up that is missing in D5. I've copied the relevant parts from my BDS2006 source and written a small D5Compat glue unit to provide this functionality. However I need to change the uses clauses of some Nx* units to make this work. Would you mind adding something like
CODE
  {$IFNDEF DELPHI6_OR_UP} D5Compat, {$ENDIF}
to the relevant units? Or maybe {$IFDEF USE_EXPERIMENTAL_D5_COMPAT_HACK}? biggrin.gif
And remember: This works only for people who are able to get the DateUtils, StrUtils etc source or rewrite large parts of it. sad.gif

(4) In TNxCustomGridControl.SaveToTextFile, you use Write(f, ...) to output WideStrings. D5 doesn't seem to support this. Do you have an idea how to solve this task D5 compatibly?

Enough for now and thanks for reading,
Uli.

#2 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,191 posts
  • Gender:Male

Posted 08 November 2006 - 11:42 PM

Hello Uli,

I have discontinue with Delphi 5 compatibility because there was a lot differences between units, and design-time editors sad.gif

regards
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.

#3 uli

uli
  • Members
  • 26 posts

Posted 09 November 2006 - 10:09 AM

Hi Boki,

QUOTE (Boki (Berg) @ Nov 8 2006, 11:42 PM) <{POST_SNAPBACK}>
I have discontinue with Delphi 5 compatibility because there was a lot differences between units, and design-time editors sad.gif

Yes, I know. The intent of my suggestions was to make it easier (less painful? smile.gif) for me and maybe other D5 users (are there any left?) to get your components to work under D5, not to make you implement full D5 support. I know that that'd be a big effort.
Especially items (1)+(2) would be nice to have and wouldn't clutter up your source code at all.
The impact of item (3) would be one ifdef'ed unit in maybe 10 units, but I admit that this solution is far from elegant. smile.gif

Thank you for answering,
Uli.

#4 Markus

Markus
  • Members
  • 54 posts

Posted 09 November 2006 - 12:03 PM

Hi Uli,

QUOTE (uli @ Nov 9 2006, 10:09 AM) <{POST_SNAPBACK}>
The intent of my suggestions was to make it easier (less painful? smile.gif) for me and maybe other D5 users (are there any left?)


Here's my "NxDelphi5Support.pas" I'm using for Delphi 5 compatibility in NextInspector. I did not yet start to do the same for NextGrid though.

Cheers,
Markus

Attached Files


It compiles, ship it!

#5 uli

uli
  • Members
  • 26 posts

Posted 09 November 2006 - 02:34 PM

QUOTE (Markus @ Nov 9 2006, 12:03 PM) <{POST_SNAPBACK}>
Here's my "NxDelphi5Support.pas" I'm using for Delphi 5 compatibility in NextInspector. I did not yet start to do the same for NextGrid though.

Thanks, Markus.
For me it's the other way round - I only need NextGrid up to now. Nevertheless the compatibility stuff that I have got up to now looks similar to yours. However I wouldn't post it in public wink.gif , because it's copied from source under Borland copyright.
As far as I see you too have to patch Boki's sources to make use of your NxDelphi5Support unit, right? That's part of the work that I wanted to spare us with my suggestions (1)-(3).

Regards,
Uli.

#6 Markus

Markus
  • Members
  • 54 posts

Posted 09 November 2006 - 03:12 PM

Hi Uli,

QUOTE (uli @ Nov 9 2006, 02:34 PM) <{POST_SNAPBACK}>
Nevertheless the compatibility stuff that I have got up to now looks similar to yours. However I wouldn't post it in public wink.gif , because it's copied from source under Borland copyright.


Well, most of the stuff is coming from FreePascal and public domain sources (at least I hope so - I don't remember exactly as the file is quite old wink.gif).

QUOTE (uli @ Nov 9 2006, 02:34 PM) <{POST_SNAPBACK}>
As far as I see you too have to patch Boki's sources to make use of your NxDelphi5Support unit, right? That's part of the work that I wanted to spare us with my suggestions (1)-(3).


Yep, that's the reason why I have set up my own NextInspector svn repository and keep it in sync with the latest updates/patches (there are also a lot of private patches in there). In general, I'm doing almost the same as you proposed in your first post. It works quite well this way.

Cheers,
Markus
It compiles, ship it!

#7 uli

uli
  • Members
  • 26 posts

Posted 09 November 2006 - 05:42 PM

QUOTE (Markus @ Nov 9 2006, 03:12 PM) <{POST_SNAPBACK}>
In general, I'm doing almost the same as you proposed in your first post. It works quite well this way.

OK, then I guess I'll keep it that way.

#8 uli

uli
  • Members
  • 26 posts

Posted 21 November 2006 - 05:31 PM

QUOTE (uli @ Nov 7 2006, 11:48 AM) <{POST_SNAPBACK}>
(4) In TNxCustomGridControl.SaveToTextFile, you use Write(f, ...) to output WideStrings. D5 doesn't seem to support this. Do you have an idea how to solve this task D5 compatibly?

Judging from what I've found in Usenet (and from the fact that the problem occurs in a routine called WriteAnsi smile.gif), Write(f, ws) for a WideString ws does the same as Write(f, AnsiString(ws)). Can anybody confirm this?

Thanks in advance,
Uli.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users