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
How to download a file fr...
by
maurobio
[
Today
at 02:04:49 am]
Hex2Dec, strange result
by
dseligo
[
Today
at 12:05:31 am]
any one knows how to set ...
by
Seenkao
[June 04, 2023, 11:41:41 pm]
Best way to include lots ...
by
KodeZwerg
[June 04, 2023, 10:54:51 pm]
Does FPC uses any interme...
by
Bart
[June 04, 2023, 10:46:54 pm]
Any way to intercept stdo...
by
rishav
[June 04, 2023, 10:40:31 pm]
Are We Dead Yet?
by
SymbolicFrank
[June 04, 2023, 09:57:00 pm]
.cvd ClamAV database comp...
by
Turkeytmfounder
[June 04, 2023, 08:56:29 pm]
Changes in "Search Result...
by
n7800
[June 04, 2023, 07:26:45 pm]
Working with the canvas o...
by
Jonax
[June 04, 2023, 05:31:27 pm]
ControlAtPos Behavior
by
Zoran
[June 04, 2023, 04:24:32 pm]
TDBGrid extended like Acc...
by
dsiders
[June 04, 2023, 03:49:48 pm]
Improvement of procedure ...
by
Martin_fr
[June 04, 2023, 03:20:51 pm]
How do I set these packag...
by
lazpas
[June 04, 2023, 01:30:01 pm]
How can I capture all key...
by
jamie
[June 04, 2023, 12:54:37 pm]
general reference manual ...
by
simone
[June 04, 2023, 12:38:19 pm]
[SOLVED] Help for downloa...
by
rvk
[June 04, 2023, 12:24:10 pm]
Clean up at ide/include/i...
by
JuhaManninen
[June 04, 2023, 11:21:20 am]
[SOLVED] LAMW BackButton ...
by
c4p
[June 04, 2023, 08:33:39 am]
help choosing laptop
by
dbannon
[June 04, 2023, 07:38:49 am]
TBufferDataSet List Index...
by
eldonfsr
[June 04, 2023, 01:54:18 am]
Tips for deep debuging of...
by
Grew
[June 03, 2023, 10:46:22 pm]
discarding an array
by
robert rozee
[June 03, 2023, 09:54:10 pm]
TSynEdit crashes when loa...
by
Martin_fr
[June 03, 2023, 09:37:47 pm]
How to create form in thr...
by
PascalDragon
[June 03, 2023, 07:22:32 pm]
« previous
next »
Print
Pages: [
1
]
Author
Topic: StrComp problem(Solved) (Read 265 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: 1399
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