Lazarus
Home
Help
TinyPortal
Search
Login
Register
Lazarus
»
Forum
»
Programming
»
General
»
TFPGMap sort on data
Free Pascal
Website
Downloads
Wiki
Documentation
Bugtracker
Mailing List
Lazarus
Website
Downloads (Laz+FPC)
Packages (OPM)
FAQ
Wiki
Documentation (RTL/FCL/LCL)
Bugtracker
CCR Bugs
GIT
Mailing List
Other languages
Foundation
Website
Useful Wiki Links
Project Roadmap
Getting the Source
Screenshots
How to use the forum
Forum Rules
About donations (wiki)
Bookstore
Computer Math and Games in Pascal
(preview)
Lazarus Handbook
Search
Advanced search
Recent
[SOLVED] GTK3 : Icons hav...
by
zeljko
[
Today
at 10:40:09 pm]
Debian releases a Gtk3 La...
by
zeljko
[
Today
at 10:32:15 pm]
Getting results from sql ...
by
CraigC
[
Today
at 10:00:24 pm]
add thumb up or like butt...
by
Martin_fr
[
Today
at 09:35:13 pm]
Problem with drawing orde...
by
wp
[
Today
at 06:26:27 pm]
TChart: Wrong default val...
by
wp
[
Today
at 06:22:26 pm]
Hello! Anything new?
by
simone
[
Today
at 05:47:57 pm]
LAMW Foreground service -...
by
Mongkey
[
Today
at 05:40:05 pm]
could Ardour's YTK be use...
by
Fred vS
[
Today
at 04:59:52 pm]
Any way to "embed" Window...
by
myisjwj
[
Today
at 02:50:41 pm]
mORMot again (HttpServer/...
by
ttomas
[
Today
at 12:45:49 pm]
Is it me or is there some...
by
Martin_fr
[
Today
at 11:48:04 am]
Exiting HeapTrace dump
by
jamie
[
Today
at 11:34:49 am]
CONCAT formula
by
Zvoni
[
Today
at 08:17:21 am]
emuloader: help to resurr...
by
arcadegamer
[March 15, 2026, 08:30:31 pm]
AutoSize TMemo.Height?
by
wp
[March 15, 2026, 05:55:05 pm]
Initialization & finaliza...
by
Martin_fr
[March 15, 2026, 05:24:36 pm]
Possible Enhancement to t...
by
jamie
[March 15, 2026, 04:10:38 pm]
lazarus 4.99 and missing ...
by
wp
[March 15, 2026, 03:11:43 pm]
Questions about TFuncSeri...
by
hedgehog
[March 15, 2026, 06:58:29 am]
CryptoLib4Pascal
by
Xor-el
[March 14, 2026, 06:17:32 pm]
Extended Module Player
by
Gigatron
[March 14, 2026, 05:32:06 pm]
[AGGPas] Difference betwe...
by
Roland57
[March 14, 2026, 04:36:02 pm]
« previous
next »
Print
Pages: [
1
]
Author
Topic: TFPGMap sort on data (Read 893 times)
apeoperaio
Sr. Member
Posts: 293
TFPGMap sort on data
«
on:
February 06, 2023, 06:05:17 pm »
How can I sort a TFPGMap on data instead of on keys?
How should I use OnDataCompare and Sort?
Thanks.
Andrea
Logged
Thaddy
Hero Member
Posts: 18797
Glad to be alive.
Re: TFPGMap sort on data
«
Reply #1 on:
February 06, 2023, 06:56:31 pm »
Sorting on data is useless. Be more specific.
Logged
Recovered from removal of tumor in tongue following tongue reconstruction with a part from my leg.
marcov
Administrator
Hero Member
Posts: 12721
FPC developer.
Re: TFPGMap sort on data
«
Reply #2 on:
February 06, 2023, 08:59:53 pm »
If you need data sorted on multiple keys, use multiple maps and define some procedure/methods that check them both for removal/addition.
Logged
apeoperaio
Sr. Member
Posts: 293
Re: TFPGMap sort on data
«
Reply #3 on:
February 06, 2023, 09:04:02 pm »
@Thaddy, I am using TFPGMap as a dictionary <integer, integer> and I need to sort by Data and not by Key. Why should be useless?
Should I use a different class? Why the method OnDataCompare is available if it is considered useless?
Logged
marcov
Administrator
Hero Member
Posts: 12721
FPC developer.
Re: TFPGMap sort on data
«
Reply #4 on:
February 06, 2023, 09:16:57 pm »
fpSmap seems to have an indexdata method. That seems the only place it is used, but it is an iteration, not a map.
Logged
Print
Pages: [
1
]
« previous
next »
Lazarus
»
Forum
»
Programming
»
General
»
TFPGMap sort on data
TinyPortal
© 2005-2018