[next] [tail] [up]

### 7.1 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. Duplicate case labels are not allowed. This is a bug in Turbo Pascal and will not be changed.
2. 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, (see page 5.1) option solves this.)
3. The MEM, MEMW, MEML and PORT variables for memory and port access are not available in the system unit. This is due to the operating system. Under D O S, the extender unit (GO32.PPU) implements the mem constuct. under L I N U X, 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 will work only on the D O S target.
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 G N U as. However, other assembler forms are available. For more information, see Programmers guide.
9. Turbo Vision is not completely available. There is FreeVision, but the degree of compatibility with Turbo Vision is unclear at this time1.
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.
15. Sets are always 4 bytes in Free Pascal; this means that some typecasts which were possible in Turbo Pascal are no longer possible in Free Pascal.
16. A file is opened for output only (using fmOutput) when it is opened with Rewrite. In order to be able to read from it, it should be reset with Reset.
17. Destructors cannot have parameters. This restriction can be solved by using the -So switch.
18. There can be only one destructor. This restriction can also be solved by using the -So switch.
19. The order in which expressions are evaluated is not necessarily the same. In the following expression:

              a := g(2) + f(3);

    it is not guaranteed that g(2) will be evaluated before f(3).

[next] [front] [up]