Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation on 06/22/24 in all areas

  1. Uwe Raabe

    Serialize/Deserialize Enums with no RTTI

    I know, that probably won't solve your problem, but I usually get rid of these kind of enumerations in favor of proper ones supported by RTTI. The numerical values are handles by record helpers: type TReportTypeCode = (reportTypeCodeSTR, reportTypeCodeLCTR, reportTypeCodeCDR, reportTypeCodeLVCTR, reportTypeCodeEFTR); TReportTypeCodeHelper = record helper for TReportTypeCode private const cMapping: array[TReportTypeCode] of Integer = (102, 106, 113, 14, 145); function GetAsInteger: Integer; procedure SetAsInteger(const Value: Integer); public property AsInteger: Integer read GetAsInteger write SetAsInteger; end; function TReportTypeCodeHelper.GetAsInteger: Integer; begin Result := cMapping[Self]; end; procedure TReportTypeCodeHelper.SetAsInteger(const Value: Integer); begin for var idx := Low(Self) to High(Self) do begin if cMapping[idx] = Value then begin Self := idx; Exit; end; end; raise EInvalidOperation.Create('invalid Integer value for TReportTypeCode'); end; Now there is no more casting to and from Integers.
  2. Angus Robertson

    ICS V9.2 announced

    ICS V9.2 is now also available from GetIt for Delphi 11 and 12, thanks Embarcadero. Angus
  3. As I struggled yet again with the IDE (Delphi 12.1) this morning and visited embarcadero web page to see if they have released a few fixes to make my days a little better, I was just thinking if they could actually come ou with Yet A Slower And Buggier release, hence my suggestion. Sorry to the village named YASAB for venting. I mean no disrespect. Can someone explain how an IDE so buggy that takes longer than it takes to boot windows to even show a splash screen could be released to its long-paying customers. A SHAME
×