add the line
Code:
{$Mode Delphi}
at the top (after program programname; bit) and give it a shot.

Assuming you use windows:

Code:
fpc source.pas -MDelphi
should do the trick. If it doesn't, some tweaking may be required. hope this helped.