Spring4D: How is the GlobalContainer intended to be used? Are there important don’ts? – Google Groups
Posted by jpluimers on 2014/08/04
Short answer: do not use the GlobalContainer.
Long answers are in this Spring4D thread: How is the GlobalContainer intended to be used? Are there important don’ts? – Google Groups.
Especially read this message by Stefan Glienke that shows you to setup your main program without using GlobalContainer at all.
Note that this doesn’t mean you should avoid a container at all.
Background information:
–jeroen






IL said
Thank you for the notice. I’ve learnt about TSortedList in DEHL and uSortCustomers.pas in Spring4d (perhaps older version before TSortedList was introduced), but I couldn’t figure out how to use it to keep the collection TList(Key:Integer,TList(Data:Integer)) sorted with only top 10 numbers in it. In fact I don’t like the idea of filling whole collection before doing the sort instead of doing sorted insert.
IL said
Here is my 1st little program using generics made intentionally in Delphi XE – GetDocumentsPath, you know :) http://pastebin.com/V7ZH1y8M
It sorts file names in $HOME/My Documents/123.txt (exported from Everything) to find 10 longest elements.
Could you have a look at the code and tell me of any basic misuse of generics you can see there.
Did I missed generic TSortedList have been invented already?
The code should be documented to be easy to read, sorry, but it is self explanatory enough.
Thank you.
sglienke said
Spring4D in fact has a TSortedList.
IL said
Thank you for the notice. I knew of TSortedList in DEHL and uSortCustomers.pas in Spring4d, and it still botheres me that I couldn’t figure out how to use it for my task to keep TList<Key:integer,TList collection sorted. In fact I don’t like the idea to fill the collection completely before doing the sort instead of doing sorted insert.
jpluimers said
Sorry: pastebin.com is blocked from where I’m right now.