Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation on 03/17/20 in all areas

  1. Cristian Peța

    Set a PC environment based on a Country name..

    Don't use date as string in SQL filters. Pass dates as parameters. That calendar component should give you the date as TDate or something, not string.
  2. Fr0sT.Brutal

    Set a PC environment based on a Country name..

    Aha! That's the very issue! And I'd say you trying to cure a consequence instead of a cause. One of developer rules I discovered is to NEVER ever rely on any regional settings other than for displaying purposes. Especially where any kind of communication between two PCs involved. In your case, DB should never accept or send a timestamp as a string. Just never. If there's no such ability, just carve timestamp format in stone and use it everywhere for internal communication. Of course, for display purposes use local settings (f.ex., American mm/dd/yy format makes other people crazy). @Sherlock it wasn't clear enough
  3. I have the strong feeling, that putting this much thought into that seemingly simple class will lead to "What the hell was I thinking?" sometime in the not so far future. KISS really is my prime directive when it come to software development.
  4. The purpose of a class constructor is to initialize the class to a known initial state when it's created. Imagine having to different ways to start your car if you were alone or if you had passengers, just so the system that supports airbags knows whether to only activate the Driver's-side airbag or all of them. Airbag activation based on secondary properties that can't be known until run-time (ie, how many people get into the car) is not part of the object's "initial state". FIRST you start the car. THEN you do other things like activate the airbags. You do NOT want to have different ways of starting the car based on factors that depend upon secondary systems. It doesn't need to be airbags -- it could be A/C vs. Heater; driving in the day vs. at night where lights are required; etc. Creating your objects is like starting the car and getting the engine running. C++ and C# (among others) have a way to inject initial state data into constructors at the time of declaration vs. run-time. Delphi doesn't have that ability, so you need to inject the really core initial parameters in the Create call, and then add others AFTER the object has been initialized via property injection.
  5. Sherlock

    Improve the Structure Panel?

    @Fr0sT.Brutal If you have nothing substantial to contribute to a users topic please refrain from posting.
  6. Ok. Try to restructure your units until TINIComparer and TCompareType are in the same unit, and don't be shy creating 2-3 more units if needed. Unseen, i would say, your structure is done when "uINIComparerStructure" becomes empty.
  7. constructor Create(const AIniFileName1, AIniFileName1: string; AOptions: TCompareOptions = []); Where else would you declare TCompareOptions as in the same unit as this class is?
×