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
Forum Rules
About donations (wiki)
Bookstore
Computer Math and Games in Pascal
(preview)
Lazarus Handbook
Search
Advanced search
Recent
Lazarus for Windows on aa...
by
Martin_fr
[
Today
at 07:58:29 am]
FastCGI vs. CGI
by
egsuh
[
Today
at 06:33:08 am]
FPC Unleashed (async/awai...
by
Fibonacci
[
Today
at 06:24:39 am]
Indy10 hangs the app if u...
by
Remy Lebeau
[
Today
at 04:15:38 am]
I have made some progress...
by
onionmixer
[
Today
at 12:32:08 am]
Network drop and firewall
by
kupferstecher
[
Today
at 12:01:58 am]
Lazarus Bugfix Release 4....
by
n7800
[July 19, 2026, 10:59:09 pm]
Can not load postgres cli...
by
martinm
[July 19, 2026, 10:17:31 pm]
Gtk3 widgetset - call for...
by
zeljko
[July 19, 2026, 08:21:54 pm]
an error occurred while c...
by
Seenkao
[July 19, 2026, 07:29:14 pm]
RichMemo and GTK3
by
dsiders
[July 19, 2026, 05:15:45 pm]
Desktop Shortcut
by
J-G
[July 19, 2026, 04:49:33 pm]
ProDAW
by
jamie
[July 19, 2026, 04:14:20 pm]
Which quantized model wor...
by
LeP
[July 19, 2026, 04:12:28 pm]
[ANN] fpGUI Toolkit v2.1....
by
cdbc
[July 19, 2026, 01:41:07 pm]
Ask AI to make fast HEX t...
by
paweld
[July 19, 2026, 01:23:08 pm]
Isn’t this funny?
by
backprop
[July 19, 2026, 12:25:46 pm]
Windows Installer with FP...
by
Martin_fr
[July 19, 2026, 07:42:28 am]
GTK3 is now the default w...
by
dbannon
[July 19, 2026, 03:25:30 am]
Parsing error?
by
jlinux
[July 19, 2026, 02:15:42 am]
Putting a new file on a w...
by
J-G
[July 18, 2026, 11:10:43 pm]
[SOLVED]Problem with Mari...
by
Tomu
[July 18, 2026, 10:49:15 pm]
debugger error
by
Martin_fr
[July 18, 2026, 10:38:42 pm]
TCHATGPT — An Artificial ...
by
schuler
[July 18, 2026, 10:00:48 pm]
Slow app start on M5 MacB...
by
Thaddy
[July 18, 2026, 08:16:52 pm]
« previous
next »
Print
Pages:
1
[
2
]
Author
Topic: Comparison operator (Read 2542 times)
marcov
Administrator
Hero Member
Posts: 12955
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: 19464
Glad to be alive.
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
Any "programmer" that knows only one programming language is not a programmer
Warfley
Hero Member
Posts: 2071
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