Rename result with the name of the function they are in. Result is a construct of newer incarnations of the language than TP. Or simple use a more modern mode ({$Mode objFPC} or {$Mode Delphi})
Not necessary. Simply add {$modeswitch result} on top of affected units. I hinted already at some little problems, but the code itself simply works in both 16 and 32 bit Freepascal. I didn't test 64 bit, though. (probably won't work, it is soooo old). {$mode delphi} is also OK it seems. The code is Delphi 2 compatible.