Recent

Author Topic: MVP made easier.  (Read 15056 times)

cdbc

  • Hero Member
  • *****
  • Posts: 2508
    • http://www.cdbc.dk
Re: MVP made easier.
« Reply #75 on: April 24, 2025, 07:31:03 pm »
Hi Hans
That's probably a good idea, sometimes it helps to visualize the buildup and the flow, to understand what's going on ...when & how...
Regards Benny
If it ain't broke, don't fix it ;)
PCLinuxOS(rolling release) 64bit -> KDE6/QT6 -> FPC Release -> Lazarus Release &  FPC Main -> Lazarus Main

Hansvb

  • Hero Member
  • *****
  • Posts: 863
Re: MVP made easier.
« Reply #76 on: April 24, 2025, 08:27:33 pm »
hi,

Sometimes I feel very stupid. It took me an hour to figure out that in the TTransaction = class... this line is gone in the new version:
Code: Pascal  [Select][+][-]
  1. constructor Create(aModReason: word); virtual;

I didn't understand why I couldn't get into the create overload of my new transaction. (Not using the TransactionFactory). There just is no create function to overload. I removed the overload and now i get into my transaction create function again.
Time to stop for today.

Thanks for all the effort!



cdbc

  • Hero Member
  • *****
  • Posts: 2508
    • http://www.cdbc.dk
Re: MVP made easier.
« Reply #77 on: August 28, 2025, 08:03:34 pm »
Hellllloooooo
Right, so I had to update the 'istrlist.pas' to coerce it to compile with FPC v3.2.4
That ofc. means updating MVP-Setup too, as it depends heavily on 'IStrings' and co. It's a small update, so only date-bump in version number...
...So get it HERE while it's hot8-)
Regards Benny
If it ain't broke, don't fix it ;)
PCLinuxOS(rolling release) 64bit -> KDE6/QT6 -> FPC Release -> Lazarus Release &  FPC Main -> Lazarus Main

Hansvb

  • Hero Member
  • *****
  • Posts: 863
Re: MVP made easier.
« Reply #78 on: August 28, 2025, 09:24:54 pm »

░░░░░░░░░░░░░░░░░░░░░░█████████
░░███████░░░░░░░░░░███▒▒▒▒▒▒▒▒███
░░█▒▒▒▒▒▒█░░░░░░░███▒▒▒▒▒▒▒▒▒▒▒▒▒███
░░░█▒▒▒▒▒▒█░░░░██▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒██
░░░░█▒▒▒▒▒█░░░██▒▒▒▒▒██▒▒▒▒▒▒██▒▒▒▒▒███
░░░░░█▒▒▒█░░░█▒▒▒▒▒▒████▒▒▒▒████▒▒▒▒▒▒██
░░░█████████████▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒██
░░░█▒▒▒▒▒▒▒▒▒▒▒▒█▒▒▒▒▒▒▒▒▒█▒▒▒▒▒▒▒▒▒▒▒██
░██▒▒▒▒▒▒▒▒▒▒▒▒▒█▒▒▒██▒▒▒▒▒▒▒▒▒▒██▒▒▒▒██
██▒▒▒███████████▒▒▒▒▒██▒▒▒▒▒▒▒▒██▒▒▒▒▒██
█▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒█▒▒▒▒▒▒████████▒▒▒▒▒▒▒██
██▒▒▒▒▒▒▒▒▒▒▒▒▒▒█▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒██
░█▒▒▒███████████▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒██
░██▒▒▒▒▒▒▒▒▒▒████▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒█
░░████████████░░░█████████████████

cdbc

  • Hero Member
  • *****
  • Posts: 2508
    • http://www.cdbc.dk
Re: MVP made easier.
« Reply #79 on: November 25, 2025, 05:59:46 pm »
G'Day folks
Right, so I updated 'istrlist.pas' to support 2 new 'Reverse' features and in doing so I /reintroduced/ 2 existing methods, to properly cater for objects, strings & 'Self'; Now it doesn't _wipe_ the objects anymore  O:-)
That ofc. means updating MVP-Setup too, as it depends heavily on 'IStrings' and co. It's a small update, so only date-bump in version number...
...So get it HERE while it's hot.  8-)
Regards Benny
If it ain't broke, don't fix it ;)
PCLinuxOS(rolling release) 64bit -> KDE6/QT6 -> FPC Release -> Lazarus Release &  FPC Main -> Lazarus Main

Hansvb

  • Hero Member
  • *****
  • Posts: 863
Re: MVP made easier.
« Reply #80 on: November 29, 2025, 02:29:46 pm »
Hi Benny,

I haven't really tested istrlist.pas. I just replaced istrlist.pas with the new one in an existing project and get no errors  :). I haven't looked at the new features yet. My time is currently spent on another little Lazarus project.


cdbc

  • Hero Member
  • *****
  • Posts: 2508
    • http://www.cdbc.dk
Re: MVP made easier.
« Reply #81 on: December 01, 2025, 01:19:56 pm »
Hi Hans
Good to hear from you mate, I hope all is well on your end of things =^
It should work straight out of the box  :-X Nice to hear that it does  :D
Here's the short story:
@lar unwillingly stumbled upon a bug in 'TStrings'  :(  So a couple of us tried to help him out and got to analyzing the code in 'TStrings'. @BrunoK noticed that the current implementation doesn't cater for the objects when calling 'Reverse', it wipes them out  >:( @Zvoni noticed that calling 'Reverse' alone didn't reverse itself and @Thaddy tried to call it with itself, to no avail...
So in all togetherness, we figured it out and while the rest cooked up a bug-report and filed it, I implemented the changes and features in 'IStrings'.
The net-result is:
a Reintroduced 'function Reverse: TStrings;' { not much changed }
a Reintroduced 'procedure Reverse(aList: TStrings);' { includes objects and self }
a New 'function ReverseEx: IStrings;' { returns a com-object - no freeing after use }
a New 'procedure ReverseSelf;' { does what the name says }
Code: Pascal  [Select][+][-]
  1. function TiStringList.Reverse: TStrings; { reintroduce }
  2. begin
  3.   Result:= TStringsClass(Self.ClassType).Create;
  4.   try Reverse(Result);
  5.   except FreeAndNil(Result); Raise; end;
  6. end;
  7.  
  8. procedure TiStringList.Reverse(aList: TStrings); { reintroduce }
  9. var li: ptrint;
  10. begin { the existing one in classes wipes the objects -- they were gone afterwards!!! }
  11.   if aList = Self then begin ReverseSelf; exit; end; { someone might do this }
  12.   for li:= inherited Count-1 downto 0 do
  13.     aList.AddObject(Strings[li],Objects[li]); { copy strings & objects in reverse order to aList }
  14. end;
  15.  
  16. function TiStringList.ReverseEx: IStrings;
  17. begin
  18.   Result:= CreStrings; { we need a new result stringlist }
  19.   Reverse(Result.AsTStrings); { now get the reversed result from reintroduced method }
  20. end;
  21.  
  22. procedure TiStringList.ReverseSelf;
  23. var lsl: IStringList; { we need an interim list }
  24. begin
  25.   lsl:= ReverseEx as IStringList; { fetch our own reverse }
  26.   AssignEx(lsl); { now clear ourselves and assign the reverse list to us }
  27. end;
I made all the changes in FPC-release / Lazarus-release, as to make sure, there would be no surprises  8-)
You may notice a 'blob.istrlist.inc' in the 'IStringlist' repo, that's for easy integration in MVP-Setup \o/\ö/\o/
Pheeewwww, Glad it works -- Happy coding mate =^
Regards Benny
If it ain't broke, don't fix it ;)
PCLinuxOS(rolling release) 64bit -> KDE6/QT6 -> FPC Release -> Lazarus Release &  FPC Main -> Lazarus Main

 

TinyPortal © 2005-2018