Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation on 01/02/22 in all areas

  1. David Hoyle

    Issues with VirtualTreeView in DUDS

    Looking at the first repository, it's 5 years old and I know the VTV has been updated extensively in those years so the DUD code may be expecting say version 5.3 of VTV or earlier. From V6.0 onwards there were significant changes. VTV is not shown as a submodule so I assume you are using a library version. You might want to make a copy and then check out an older version of VTV to see if it can compile.
  2. Foersom

    Encrypting string

    Delphi Encryption Compendium, version 6.x, can do everything and is free. https://github.com/MHumm/DelphiEncryptionCompendium
  3. Kim Madsen

    Encrypting string

    kbmMW Community Edition is free and contains what you need.
  4. Attila Kovacs

    calculete time in delphi

    As long as it's a windows application yes, use GetTickCount64. Whereas both will count the time the computer is in sleep or in hibernation. Not sure about TStopWatch.
  5. Angus Robertson

    calculete time in delphi

    You should never use TDateTime for duration calculations, users can change the system time, and summer time saving changes it twice a year (unless you use UTC time). Always use the difference between two GetTickCount64 Int64 values. Angus
  6. Do you have the CreateDatabase param set. e.g. FDConnection1.Params.Values['CreateDatabase']:=BoolToStr(not FileExists(FDConnection1.Params.Database),True);
  7. Attila Kovacs

    calculete time in delphi

    just use the 2 TDateTime values, start/stop and use System.DateUtils.SecondsBetween(start, stop).
  8. PeterBelow

    calculete time in delphi

    DecodeTime is the wrong method to use since it decodes a time point, not a time interval. The System.Diagnostics.TStopwatch record may be of more use for your problem. Add a private field FStopwatch: TStopwatch; to your form. In the OnCreate event you start the stopwatch with FStopwatch := TStopwatch.StartNew; When you want to know the elapsed time call FStopwatch.Stop first and then examine the Elapsed property. It returns a TTimespan record, which has properties to dissect the time interval into days, hours, minutes etc.
  9. David Heffernan

    Move a Function or Procedure to a Unit??

    Get Martin Fowler's book on refactoring.
  10. Rollo62

    Move a Function or Procedure to a Unit??

    TLDR; I think you mixed too many stuff in one method. I would separate this into different domains, each in a unit, e.g. like UMailSend.pas, USysInfo.pas, and the caller I usually encapsule separate functions into classes, with static functions/methods. This behaves same like functions or methods, but keep them under a "namespace" of the class, which could be extended if needed. type TMail = class class function Send( AReceiver, AMessage : String, ...); static; end;
  11. Vandrovnik

    SFTP client

    Today I found and just briefly tested this: https://github.com/superflexible/TGPuttyLib
×