Lazarus
Home
Help
TinyPortal
Search
Login
Register
Lazarus
»
Forum
»
Free Pascal
»
Beginners
(Moderators:
FPK
,
Tomas Hajny
) »
StrComp problem(Solved)
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
min() function behavior i...
by
han
[
Today
at 10:20:23 pm]
[Solved] OnMouseDown - Ho...
by
marcio2003
[
Today
at 08:46:43 pm]
LazPaint (alpha-blending,...
by
CM630
[
Today
at 08:35:04 pm]
Default and speed effect
by
Martin_fr
[
Today
at 06:22:00 pm]
Why is the rectangle the ...
by
Bart
[
Today
at 05:56:45 pm]
process exeuction with in...
by
Edson
[
Today
at 05:33:56 pm]
How to dock Stack and Pro...
by
Molochnik
[
Today
at 05:18:45 pm]
BufferData not let appen...
by
paweld
[
Today
at 05:18:39 pm]
PostgreSQL: typeinfo erro...
by
Чебурашка
[
Today
at 05:16:48 pm]
Problema con base de dato...
by
Edson
[
Today
at 04:35:57 pm]
Adding Text to LineSerie ...
by
Dzandaa
[
Today
at 03:27:54 pm]
Best way to delete an ins...
by
Tomi
[
Today
at 02:59:21 pm]
Fast Base64 encoding/deco...
by
Okoba
[
Today
at 02:37:57 pm]
Hole punching - Step by S...
by
Warfley
[
Today
at 02:28:15 pm]
Anonymous Unions-Middle R...
by
jamie
[
Today
at 02:07:59 pm]
[Solved] TTreeFilterEdit....
by
AlexTP
[
Today
at 01:49:57 pm]
TFPGObjectList and custom...
by
jamie
[
Today
at 01:38:51 pm]
OPC client with Lazarus
by
Miniekans
[
Today
at 01:35:54 pm]
Threads - stringlist and ...
by
Warfley
[
Today
at 01:28:00 pm]
How to use customize outp...
by
artem101
[
Today
at 11:38:43 am]
Code clean up at TFontMan...
by
howardpc
[
Today
at 10:37:59 am]
Improvements in rtl/objpa...
by
lagprogramming
[
Today
at 09:01:19 am]
Magic, non referenced var...
by
Fibonacci
[
Today
at 07:17:05 am]
any one compile the gba e...
by
greenzyzyzy
[
Today
at 07:03:11 am]
Reading MAC address of Ac...
by
denerdener
[
Today
at 05:59:28 am]
« previous
next »
Print
Pages: [
1
]
Author
Topic: StrComp problem(Solved) (Read 254 times)
JLWest
Hero Member
Posts: 1293
StrComp problem(Solved)
«
on:
April 01, 2023, 01:32:45 am »
Trying to compare two strings;
I don't understand what wrong with this.
Didn't know it mattered.
It compiled. I haven't tested it yet.
Sometimes just sName=sTag works and sometimes not. Wonder why?
Code: Pascal
[Select]
[+]
[-]
VAR
P1
:
PChar
;
P2
:
PChar
;
C
:
SizeInt
;
aName
,
aTag
:
String
;
begin
P1
:
=
sName
;
<<<duplicates
.
pas
(
243
,
10
)
Error
:
Incompatible types
:
got "AnsiString" expected "PChar"
p2
:
=
sTag
;
C
:
=
strcomp
(
P1
,
P2
)
;
«
Last Edit: May 11, 2023, 01:07:26 am by JLWest
»
Logged
FPC 3.2.0, Lazarus IDE v2.0.4
Windows 10 Pro 32-GB
Intel i7 770K CPU 4.2GHz 32702MB Ram
GeForce GTX 1080 Graphics - 8 Gig
4.1 TB
KodeZwerg
Hero Member
Posts: 1396
Fifty shades of code.
Re: StrComp problem
«
Reply #1 on:
April 01, 2023, 01:36:55 am »
I do not know why you hide your declaration of sName, anyway, "P1 := PChar(sName);" should solve your issue.
Logged
«
Last Edit:
Tomorrow
at 31:76:97 by
KodeZwerg
»
Print
Pages: [
1
]
« previous
next »
Lazarus
»
Forum
»
Free Pascal
»
Beginners
(Moderators:
FPK
,
Tomas Hajny
) »
StrComp problem(Solved)
TinyPortal
© 2005-2018