Jump to content

Leaderboard


Popular Content

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

  1. Angus Robertson

    Location change bug with fragment

    You were correct, a fragment/anchor/bookmark in the URL should never be sent to the server, it is purely an instruction to the browser on how to display the page. The ICS unit did attempt to remove # during relocation, but relocation has many different paths in the code, and it was not always being done. I've corrected in my master, won't be in SVN for a day or two, but in the latest SVN version add these lines to the function EncodePathOnly: I := Pos('#', OldPath); if I > 1 then Result := Copy (OldPath, 1, I - 1); My issue with the SSL/TLS certificate was me using an old sample application. Angus
  2. Compiler directives come to help. This is to ensure TEnum is starting from 1 (needed to loop through a string that contains chars for every item in enum) const EnumLiterals: array[TEnum] of Char = ('Q', 'W', 'E', 'R', 'T'); function SetToFixedStr(aSet: TSomeSet): string; var elem: TEnum; begin // check {$IF Ord(Low(TEnum)) <> 1} {$MESSAGE FATAL 'Must start from 1 (using as string index)'} {$IFEND} ... end Or, in every case that handles ALL values in enum: case item of enumItem1: ...; enumItemN: ...; {$IF Ord(High(TEnum)) <> 5} {$MESSAGE FATAL 'Implement it'} {$IFEND} end; // case This will catch addition to every place of enum. In case of enums starting from custom number, use Ord(High(TStatsType))-Ord(Low(TStatsType)) to get number of items. Btw, FPC catches switches that don't handle every item in an enum. Sometimes it helps, sometimes annoys 🙂
  3. Uwe Raabe

    Format uses clause

    You can define the group names per project in MMX Properties - Project options: A single identifier is treated as a group prefix which has to be followed by a dot (like System, VCL, FireDAC). You can also use wildcards like Rz* for all units from Raize Components (KSVC). Unit names not covered in one of the schemes above can be listet in brackets. This is the setting for MMX itself: (ToolsApi,DesignIntf,DCCStrs,DockForm,TabDock);Winapi;System.Win;System;Xml;Vcl;VirtualTrees*;Rz*;Tb*;Png*;MMX The settings are stored in the dproj file.
  4. Stefan Glienke

    Test Insight not drawing correctly

    Make the duration column smaller - there seems to be some glitch with it sporadically spanning the entire width making the name column not visible which I have seen occasionally but could not repro yet.
  5. Yep and they're with us since D2009 or so. Even in D7 there were $message (without modificator). Though, it could be just a plain text or anything else: {$IF ...} BADABOOM! {$IFEND} but this makes source parsing harder (like generating docs) so $message is preferred. I also add such kind of checks to places where I rely on some assumptions. F.ex., I send short 4-char string code via PostMessage directly in WPARAM so I add compiler directive to check whether the code truly fits in SizeOf(WPARAM). If sometimes the code grows, these checks won't let me forget where I should modify the algo
  6. Christophe E.

    ANN: TECNativeMap 4.3

    This version brings the support of the Mapillary api version 4 (a kind of google street view) TECNativeMap is an equivalent of Google Map without any use of a WebBrowser because it is 100% Delphi. It is available in VCL and FMX versions on all platforms supported by Delphi Download the trial version for Delphi 10.4.x
  7. I have switched to reading the header line of the data table coming in. So if data table has five fields the reads five fields. A data table with six fields reads the six 'names' through iteration. Controls are named and labeled with these 'names'. Hard coding enums for each column required rework as extra data table fields are added. How does your report handle datetime and time period if I may ask?
  8. Assuming the Tag value of each checkbox can be set to the ordinal of it's enum, you could walk the enums and check if you find a checkbox under Filters for each of them. If you don't find it - you change the caption of "Filters: to "Filters is INCOMPLETE" or log it or whatever. But - it would be runtime, preferably in the debug code. Likewise, you could easily take a set of enum values to get or set the states of the check boxes. It is a little inconvenient to do this in Generics, since we don't have a constraint for enumerated types - which means we can't really use Low, High or Ord, but it is possible.
  9. It needs some code to be added, but you can declare a const array[<enumeration>] of Integer with values 0 in all places where the enumeration is used in some way. const cCheckProjectType: array[TProjectType] of Integer = (0, 0, 0, 0); If you now extend TProjectType the compiler will stop at all places where such a declaration is present and you can inspect the code around for correct TProjectType usage. After that is done you extend the array values to make the compiler continue to the next problematic position.
  10. Fr0sT.Brutal

    Delphi compatibility with Windows 11?

    TPM sucks. Requirement of TPM sucks twice! AFAIU it could be used for DRM stuff so the soft, games and media you bought would be tied to the chip. Once it breaks, you lose all you've paid for. Moreover, it provides a unique identifier of a PC which destroys privacy.
×