They sent the source code of some project and said it was written in Delphi 6 PE . Immediately with a fool decided to try to run it in Borland Delphi and suffered a fiasco. Error, strange constructions in the code. So the question is, how can you run Delphi 6 PE code in more modern environments? I see that in the folder there are a huge number of .pas files, it should work, I would rewrite everything in a new way and the "new" delphi , but I only need a couple of functions from there and I would consistently remove everything until I needed it. But for this you need to test, so that nothing along the way of removal does not break. Maybe there are some ways to automatically port the code? The error occurs inside this structure:

 (*$DEFINE D1_OR_NEWER *) (*$IFNDEF VER80 *) (*$DEFINE D2_OR_NEWER *) (*$IFNDEF VER90 *) (*$DEFINE D3_OR_NEWER *) (*$IFNDEF VER100 *) (*$DEFINE D4_OR_NEWER *) (*$IFNDEF VER120 *) (*$DEFINE D5_OR_NEWER *) (*$IFNDEF VER130 *) (*$IFDEF LINUX *) (*$DEFINE K1_OR_NEWER *) (*$ENDIF *) (*$IFNDEF VER140 *) If the compiler gets stuck here, you are using a compiler version unknown to this code. (*$ENDIF *) (*$ENDIF *) (*$ENDIF *) (*$ENDIF *) (*$ENDIF *) (*$ELSE *) (*$DEFINE WIN16 *) (*$ENDIF *) 

It is clear that there is no support, but now there is almost no such compiler, all the links that I have seen for 10 years have been closed.

  • What version of Delphi are you trying to compile? - Anton Shchyrov
  • @AntonShchyrov, Delphi 7 - NTP
  • four
    Delphi7 is not a современная среда It was released in 2002. 16 years ago. A year after Delphi6 - Anton Shchyrov

1 answer 1

In Delphi 7, the constant VER150 . Your search for VER140 . Add a condition

 (*$IFNDEF VER130 *) (*$IFDEF LINUX *) (*$DEFINE K1_OR_NEWER *) (*$ENDIF *) (*$IFNDEF VER140 *) (*$DEFINE D6_OR_NEWER *) (*$IFNDEF VER150 *) If the compiler gets stuck here, you are using a compiler version unknown to this code. (*$ENDIF *) (*$ENDIF *) (*$ENDIF *) 

And look what happens

  • Thank you very much - NTP
  • Only I would instead of (*$DEFINE D6_OR_NEWER *) register (*$DEFINE D5_OR_NEWER *) , since someone else's code about "D6_OR_NEWER" knows nothing ... - Alekcvp
  • 2
    @Alekcvp $DEFINE D5_OR_NEWER will $DEFINE D5_OR_NEWER anyway, and $DEFINE D6_OR_NEWER will be needed if features $DEFINE D6_OR_NEWER up, D7 incompatible with D6 - Anton Shchyrov