Jump to content

Leaderboard


Popular Content

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

  1. There are many legacy projects which are still in active production. This volume offers approaches to refactoring and modernizing the code base without the need for complete redesign and rewrite. Evolution, not revolution. These are approaches well suited to the incremental revision of production code, as is usually the concern with a commercial product. Motivated by my own experience with legacy apps and the need to find a manageable approach to transforming a product in current production. On Amazon: https://www.amazon.com/dp/B0B2TY6ZZ4
  2. Fr0sT.Brutal

    date

    YearOf(aDate) mod 100
  3. Hi, I have released source code of a small game. You could see the demo here: https://youtu.be/KVNRi83yYQA Some screenshots: Github repository: https://github.com/nglthach/Swim Best!!
  4. Hi, I have just released new book: Delphi Thread Safety Patterns. https://dalija.prasnikar.info/delphitspatt/ It is on promotional sale until June,14. You can use Coupon Code: DTSPATT10 at checkout to get a $10 discount. At the moment there are two options: you can purchase eBook only or bundle: eBook and paper edition (those are separate purchases that go through different sellers and you will receive instructions for paper book with the eBook order). Paper book only on the Amazon is not available for the time being. Thank you all for the support!
  5. Mike Torrettinni

    date

    Nice, thanks!
  6. Mike Torrettinni

    date

    I have a few overloads for YY conversion, mostly used to convert from imported text files: function GetYYFromDate(const aDate: TDate): integer; overload; begin // 01/01/2019 -> 19 Result := FormatDateTime('yy', aDate).ToInteger; end; function GetYYFromDate(const aDate: TDateTime): integer; overload; begin // 01/01/2019 01:01:01 -> 19 Result := FormatDateTime('yy', aDate).ToInteger; end; function GetYYFromDate(const aDate: string): integer; overload; begin // '01/01/2019' -> 19 Result := Copy(aDate, Length(aDate) - 2, Length(aDate)).ToInteger; end; function GetYYFromYear(const aYear: string): integer; overload; begin // '2019' -> 19 Result := Copy(aYear, Length(aYear) - 2, Length(aYear)).ToInteger; end; function GetYYFromYear(const aYear: integer): integer; overload; begin // 2019 -> 19 Result := aYear mod 100; end;
  7. All I want to say is that self-contained installers rule and downloaders tend to suck. How a user could install an app on a system without internet? What if package site is down? What if connection is unstable? I'm sure 99.9% of web installers just hiccup on disconnect and stop installation making a user start whole process from the very beginning. That's my point. Decision is yours.
  8. corneliusdavid

    date

    You didn't mention whether this is a date, string, or integer value, so I'm just going to assume using the Date function: FormatDateTime('yy', Date)
  9. The solution is to use the FloatToStr overload that takes a TFormatSettings and pass one that has DecimalSeparator set to dot. I typically declare such a TFormatSettings as const and fill all the fields that are required for JSON or some other textual format like this - the following for example is being used in Spring for converting various data types to string (from TValue): const ISO8601FormatSettings: TFormatSettings = ( DateSeparator: '-'; TimeSeparator: ':'; ShortDateFormat: 'YYYY-MM-DD'; LongDateFormat: 'YYYY-MM-DD'; TimeAMString: ''; TimePMString: ''; ShortTimeFormat: 'hh:nn:ss'; LongTimeFormat: 'hh:nn:ss'; DecimalSeparator: '.'; );
  10. Hans J. Ellingsgaard

    Maximized the main form

    You could use the Constraints property of the form instead of using the Event. Self.Constraints.MaxHeight := Screen.WorkAreaHeight; Self.Constraints.MaxWidth := Screen.WorkAreaWidth;
  11. sjordi

    TListView multi selection?

    I confirm that it also works on macOS and iOS YEAH You will be in my thanks in the about box of the app.
  12. Serge_G

    TListView multi selection?

    I knew I can find a better solution not involving bitmaps in the datasource . Here is the new code procedure TForm1.ListView1UpdatingObjects(const Sender: TObject; const AItem: TListViewItem; var AHandled: Boolean); var AListItemBitmap : TListItemImage; AListItemText : TListItemText; AColor : TAlphaColor; i : Word; begin AListItemBitmap:=AItem.Objects.FindObjectT<TListItemImage>('Image2'); AListItemText:=AItem.Objects.FindObjectT<TListItemText>('Text1'); if Assigned(AListItemBitmap) then begin AListItemBitmap.OwnsBitmap:=True; // this is the trick AListItemBitmap.Bitmap:=TBitmap.Create(40,40); try AColor:=StringToAlphaColor(AListItemText.Text) except // certaines couleurs sont inconnues! i.e. monneygreen, ltgrey AColor:=TAlphaColorRec.Null; end; AListItemBitmap.Bitmap.Clear(Acolor); //:=ABitmap; end; {$ENDIF} end; See line 12. Icing on the cake freeing bitmaps created is not needed anymore ! Tested on Windows10 and Android, hope it works on OSX and iOS
×