Lazarus
Home
Help
TinyPortal
Search
Login
Register
Lazarus
»
Forum
»
Programming
»
General
»
Comparison operator
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
About donations (wiki)
Bookstore
Computer Math and Games in Pascal
(preview)
Lazarus Handbook
Search
Advanced search
Recent
UK's Online Safety Act
by
dbannon
[
Today
at 01:37:56 am]
GR32 GR_Bindings problem
by
staratel20
[
Today
at 12:50:04 am]
built IDE for qt5
by
HotShoe
[
Today
at 12:37:22 am]
Nested declarations insid...
by
Joanna from IRC
[
Today
at 12:29:42 am]
Spaces are allowed here ?
by
n7800
[January 19, 2025, 11:40:52 pm]
SQL update statement and ...
by
dseligo
[January 19, 2025, 11:19:47 pm]
Install OOPsie
by
johnsg
[January 19, 2025, 10:48:06 pm]
مشكلة في التقارير
by
nouzi
[January 19, 2025, 08:32:56 pm]
IContainers
by
cdbc
[January 19, 2025, 06:00:22 pm]
Lazarus Release Candidate...
by
baldzhang
[January 19, 2025, 05:53:07 pm]
Artificial intelligence
by
marcov
[January 19, 2025, 04:53:41 pm]
const declaration
by
marcov
[January 19, 2025, 04:51:08 pm]
A Tip for beginners
by
Thaddy
[January 19, 2025, 03:07:02 pm]
Migrate vb.net to Lazarus...
by
gidesa
[January 19, 2025, 02:50:02 pm]
Amigo programming languag...
by
maurog
[January 19, 2025, 02:47:35 pm]
Component text property i...
by
Josh
[January 19, 2025, 02:27:53 pm]
Sorting stringgrid
by
PeterX
[January 19, 2025, 01:38:34 pm]
Reading/writing Excel fil...
by
dmytro
[January 19, 2025, 12:59:32 pm]
[Solved] Width of Project...
by
Wilko500
[January 19, 2025, 12:42:21 pm]
[SOLVED] Component event ...
by
n7800
[January 19, 2025, 07:04:52 am]
FPC 3.2.4, naming suggest...
by
dbannon
[January 19, 2025, 06:31:58 am]
What is a status of fpGUI...
by
Fred vS
[January 19, 2025, 05:52:24 am]
SDL2 image rotation Probl...
by
TRon
[January 19, 2025, 12:39:30 am]
Looking For Lazarus Tutor...
by
cdbc
[January 18, 2025, 10:32:29 pm]
Fatal: Cannot find Contro...
by
Soner
[January 18, 2025, 09:58:44 pm]
« previous
next »
Print
Pages:
1
[
2
]
Author
Topic: Comparison operator (Read 1123 times)
marcov
Administrator
Hero Member
Posts: 11990
FPC developer.
Re: Comparison operator
«
Reply #15 on:
November 18, 2024, 10:35:47 am »
Quote from: jamie on November 18, 2024, 01:27:15 am
You can shorten that up using the CompareMem.
Will fail if your T record contains automated types.
Logged
Thaddy
Hero Member
Posts: 16367
Censorship about opinions does not belong here.
Re: Comparison operator
«
Reply #16 on:
November 18, 2024, 10:45:17 am »
You simply can't use comparemem in the general case anyway, there are simply too many exceptions especially if locals are compared.
Logged
There is nothing wrong with being blunt. At a minimum it is also honest.
Warfley
Hero Member
Posts: 1851
Re: Comparison operator
«
Reply #17 on:
November 18, 2024, 10:48:57 am »
Quote from: jamie on November 18, 2024, 01:27:15 am
You can shorten that up using the CompareMem.
Only if you have memory comparable types. Not all types are memory comparable. AnsiStrings and Dynamic Arrays for example aren't (and thereby also any composite type like arrays or records that contain those) and those are pretty common default types. And of course because Pascal allows for operator overloading you can easily define your own types with their own equality operators that do special comparisons.
«
Last Edit: November 18, 2024, 10:51:21 am by Warfley
»
Logged
GitHub:
https://github.com/Warfley
Print
Pages:
1
[
2
]
« previous
next »
Lazarus
»
Forum
»
Programming
»
General
»
Comparison operator
TinyPortal
© 2005-2018