7.2 Turbo Pascal

Free Pascal was originally designed to resemble Turbo Pascal as closely as possible. There are, of course, restrictions. Some of these are due to the fact that Turbo Pascal was developed for 16-bit architectures whereas Free Pascal is a 32-bit/64-bit compiler. Other restrictions result from the fact that Free Pascal works on more than one operating system.

In general we can say that if you keep your program code close to ANSI Pascal, you will have no problems porting from Turbo Pascal, or even Delphi, to Free Pascal. To a large extent, the constructs defined by Turbo Pascal are supported. This is even more so if you use the -So or -S2 switches.

In the following sections we will list the Turbo Pascal and Delphi constructs which are not supported in Free Pascal, and we will list in what ways Free Pascal extends Turbo Pascal.

  7.2.1 Things that will not work
  7.2.2 Things which are extra
  7.2.3 Turbo Pascal compatibility mode
  7.2.4 A note on long file names under dos