Next: Things which are extra
Up: Porting Turbo Pascal Code
Previous: Porting Turbo Pascal Code
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.
- 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)
- (* ... *) as comment delimiters are not allowed in versions
older than 0.9.1. This can easily be remedied with a grown-up editor.
- 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.
- 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.
- The reserved words FAR, NEAR are ignored. This is
because Free Pascal is a 32 bit compiler, so they're obsolete.
- INTERRUPT only will work on a DOS machine.
- Boolean expressions are only evaluated until their result is completely
determined. The rest of the expression will be ignored.
- 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.
- Turbo Vision is not available.
- 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.
- There are more reserved words. (see appendix B for a
list of all reserved words.)
- The command-line parameters of the compiler are different.
- Compiler switches and directives are mostly the same, but some extra
exist.
- Units are not binary compatible.
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