[fpc-pascal] converting a TP/BP library to FPC

2012-12-05 Thread waldo kitty
w2k with FPC 2.6.0 release using lazarus 1.1 only as an editor... no GUI stuffings at all... i'm using -Mtp in the project options... i have finally gotten around to trying to convert the old FTN/BBS MKSMG library to FPC... it was written for DOS TP/BP and has defines for windows which i ass

Re: [fpc-pascal] Cast, inheritance, etc

2012-12-05 Thread Chad Berchek
This is an example of why it is usually wise to use the AS operator except in performance critical places. Using the parentheses notation is an unsafe cast; type checking does not occur at the time of the cast. This is especially dangerous because you run the risk of corrupting memory by writin

Re: [fpc-pascal] converting a TP/BP library to FPC

2012-12-05 Thread Chad Berchek
Perhaps it would be sufficient to supply the time value from another source converted to the units the other code is expecting to see. Assuming the frequency for the BIOS timer is about 18.2 Hz: function TimeCounter: LongInt; begin Result := LongInt(Round(GetTickCount * 18.2065 / 1000)); end;

Re: [fpc-pascal] converting a TP/BP library to FPC

2012-12-05 Thread Mark Morgan Lloyd
waldo kitty wrote: w2k with FPC 2.6.0 release using lazarus 1.1 only as an editor... no GUI stuffings at all... i'm using -Mtp in the project options... i have finally gotten around to trying to convert the old FTN/BBS MKSMG library to FPC... it was written for DOS TP/BP and has defines for w