Extended = Double in Lazarus Win64

Note to self: In Lazarus Win64 there is no floating point type Extended, it's mapped to Double. So, overloading something like: [delphi] function TryStr2Float(const _s: string; out _flt: Extended; _DecSeparator: Char = '.'): Boolean; overload; function TryStr2Float(const _s: string; out _flt: Double; _DecSeparator: Char = '.'): Boolean; overload; function TryStr2Float(const _s: string; out _flt: Single; … Continue reading Extended = Double in Lazarus Win64

Advanced Records in Lazarus / fpc

Note to self: Delphi's Advanced Records are also available in Lazarus / Free Pascal, but only if they have been explicitly enabled with the modeswitch compiler directive: [delphi] unit SomeUnit; {$mode objfpc}{$H+}{$modeswitch advancedrecords} interface type TSomeRecord = record FSomeField: integer; function SomeMethod: integer; end; implementation function TSomeRecord.SomeMethod: integer; begin Result := FSomeField; end; end. [/delphi] … Continue reading Advanced Records in Lazarus / fpc