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
IRC channel
GIT
Mailing List
Other languages
Foundation
Website
Useful Wiki Links
Project Roadmap
Getting the Source
Screenshots
How to use the forum
About donations (wiki)
Bookstore
Computer Math and Games in Pascal
(preview)
Lazarus Handbook
Search
Advanced search
Recent
Flickering issue when mov...
by
jcmontherock
[
Today
at 10:40:13 am]
Help with HelpnDoc script...
by
jcmontherock
[
Today
at 10:32:39 am]
How to access and set pro...
by
tetrastes
[
Today
at 10:31:25 am]
CompareText improvement
by
Thaddy
[
Today
at 10:24:24 am]
Dark Theme in my program?
by
d7_2_laz
[
Today
at 09:10:37 am]
UPD message fail with Err...
by
ig
[
Today
at 08:30:18 am]
[Solved] Fatal: Cannot op...
by
vonda
[
Today
at 08:22:54 am]
Variables as indexes of a...
by
dsiders
[
Today
at 03:37:52 am]
[Solved] Can a thumbnail ...
by
jamie
[
Today
at 02:47:30 am]
Random crashes on Mac Stu...
by
jamie
[
Today
at 02:18:19 am]
« previous
next »
Print
Pages: [
1
]
Author
Topic: TFPGMap sort on data (Read 370 times)
apeoperaio
Sr. Member
Posts: 260
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: 12935
Re: TFPGMap sort on data
«
Reply #1 on:
February 06, 2023, 06:56:31 pm »
Sorting on data is useless. Be more specific.
Logged
In memory of Gordon Moore (January 3, 1929 – March 24, 2023) Just double the heaven every two years from now.
marcov
Administrator
Hero Member
Posts: 10584
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: 260
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: 10584
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