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
TBufferDataSet List Index...
by
eldonfsr
[June 03, 2023, 11:11:49 pm]
Clean up at ide/include/i...
by
Bart
[June 03, 2023, 11:03:10 pm]
LAMW BackButton not worki...
by
maurobio
[June 03, 2023, 10:51:35 pm]
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]
Are We Dead Yet?
by
440bx
[June 03, 2023, 08:34:44 pm]
How to download a file fr...
by
maurobio
[June 03, 2023, 08:32:29 pm]
Changes in "Search Result...
by
JuhaManninen
[June 03, 2023, 07:37:55 pm]
How to create form in thr...
by
PascalDragon
[June 03, 2023, 07:22:32 pm]
Who uses "caret past EOL"...
by
Martin_fr
[June 03, 2023, 06:34:39 pm]
any one knows how to set ...
by
greenzyzyzy
[June 03, 2023, 05:17:51 pm]
array of array of type?
by
jamie
[June 03, 2023, 04:42:22 pm]
if then else syntax
by
jamie
[June 03, 2023, 04:37:44 pm]
how to do a HTTP POST wit...
by
rvk
[June 03, 2023, 03:51:05 pm]
[SOLVED] SynEdit resize t...
by
Hansvb
[June 03, 2023, 03:42:16 pm]
[SOLVED] Help for downloa...
by
magleft
[June 03, 2023, 11:32:31 am]
Two issues related to fcl...
by
wp
[June 03, 2023, 11:07:07 am]
ANN: ODBC DAC under GNU G...
by
Andrey Zubik
[June 03, 2023, 01:14:38 am]
LAMW - (SOLVED) simple es...
by
Mongkey
[June 03, 2023, 12:20:54 am]
Fast Base64 encoding/deco...
by
mika
[June 02, 2023, 10:53:10 pm]
help choosing laptop
by
Leledumbo
[June 02, 2023, 08:18:27 pm]
TStringGrid : Conflict be...
by
Nel_Fie
[June 02, 2023, 06:17:51 pm]
How do I set these packag...
by
JuhaManninen
[June 02, 2023, 05:19:28 pm]
How to connect from Inter...
by
mercurhyo
[June 02, 2023, 04:59:20 pm]
« previous
next »
Print
Pages: [
1
]
Author
Topic: StrComp problem(Solved) (Read 264 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: 1398
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