Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation on 07/09/21 in all areas

  1. Idefix Pack: Sounds a little strange to me, at least in German, like to order the dog to grasp
  2. corneliusdavid

    Which setting enables this feature?

    You're on the right screen: it's Code parameters. The Delay affects how quickly the tooltip will appear (or at least that's the idea--it doesn't display at all for me automatically if the delay is anything but "None"). You can always manually activate it by hitting Ctrl+Shift+Space.
  3. Blog was moved to https://www.idefixpack.de/ some while ago already
  4. vfbb

    [Android][Rio] How catch timeout REST error?

    If you set TRESTClient's SynchronizedEvents property to False, you can do this directly: // FRequest: TRESTRequest // FClient: TRESTClient // FCanRaiseException: Boolean = {$IFDEF DEBUG}True{$ELSE}False{$ENDIF} function TryRequest: Boolean begin FClient.SynchronizedEvents := False; FRequest.Client := FClient; try FRequest.Execute; except on E: ERESTException do begin if FCanRaiseException then Exception.RaiseOuterException(Exception.Create('Service or connection failed')) else Exit(False); end; end; Result := True; end; This code is blocking, so it must be executed in a task in the background, and communicating with the UI through a queue. Just a question, what rest api do you is integrating? You may be able to make this integration faster with the Refit library: viniciusfbb/ipub-refit: Simple way to consume REST services (github.com)
  5. Lars Fosdal

    Organizing enums

    We mostly store the ordinal value of the enumerated type variable to an int in the database. Yes, it is fragile with regards to people changing the enumeration - but we have guidelines and unit tests to avoid that. type TPSDExpeditionType = (etRetailer,etWholesaler,etRetailerDairy,etWholesalerDairy); // Do not reorder or remove - add at end TLocation = class ExpeditionType: TPSDExpeditionType; We use RTTI to export the enums to a view in the database so that we can do logic in the SQL code using the same identifiers as we use in Delphi. T-SQL doesn't do constants per se, but selecting from a flat static view is optimized by the query engine and is extremely low cost. CREATE TABLE [dbo].[t_locations]( [Id] [int] IDENTITY(1,1) NOT NULL, [ExpeditionType] [int] NOT NULL -- CREATE VIEW [dbo].[v_psd_constants] AS SELECT 0 AS etRetailer, 1 AS etWholesaler, 2 AS etRetailerDairy, 3 AS etWholesalerDairy -- SELECT * FROM v_Locations loc WHERE loc.ExpeditionType = (SELECT TOP(1) etRetailerDairy FROM v_psd_constants) This means we can handle renames and additions - but not removals or reordering. From an SQL performance perspective, this runs circles around using strings.
×