next up previous contents
Next: Things which are extra Up: Porting Turbo Pascal Code Previous: Porting Turbo Pascal Code

Things that will not work

Here we give a list of things which are defined/allowed in Turbo Pascal, but which are not supported by Free Pascal. Where possible, we indicate the reason.

  1. Parameter lists of previously defined functions and procedures must match exactly. The reason for this is the function overloading mechanism of Free Pascal. (however, the -So switch solves this. See 5.1)
  2. (* ... *) as comment delimiters are not allowed in versions older than 0.9.1. This can easily be remedied with a grown-up editor.
  3. The MEM, MEMW, MEML and PORT variables for memory and port access are not available. This is due to the operating system. Under DOS, the extender unit (GO32.PPU) implements the mem constuct. under LINUX, the ports unit implements such a construct.
  4. PROTECTED, PUBLIC, PUBLISHED, TRY, FINALLY, EXCEPT, RAISE are reserved words. This means you cannot create procedures or variables with the same name. While they are not reserved words in Turbo Pascal, they are in Delphi. Using the -So switch will solve this problem if you want to compile Turbo Pascal code that uses these words.
  5. The reserved words FAR, NEAR are ignored. This is because Free Pascal is a 32 bit compiler, so they're obsolete.
  6. INTERRUPT only will work on a DOS machine.
  7. Boolean expressions are only evaluated until their result is completely determined. The rest of the expression will be ignored.
  8. By default the compiler uses AT&T assembler syntax. This is mainly because Free Pascal uses gnu as. However other assembler forms are available, Programmer's guide.
  9. Turbo Vision is not available.
  10. The 'overlay' unit is not available. It also isn't necessary, since Free Pascal is a 32 bit compiler, so program size shouldn't be a point.
  11. There are more reserved words. (see appendix B for a list of all reserved words.)
  12. The command-line parameters of the compiler are different.
  13. Compiler switches and directives are mostly the same, but some extra exist.
  14. Units are not binary compatible.

next up previous contents
Next: Things which are extra Up: Porting Turbo Pascal Code Previous: Porting Turbo Pascal Code

Michael Van Canneyt
Thu Sep 10 13:56:17 CEST 1998