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
existing variables unavai...
by
Martin_fr
[
Today
at 09:40:00 pm]
Hole punching - Step by S...
by
Key-Real
[
Today
at 08:54:19 pm]
SynEdit resize text
by
Martin_fr
[
Today
at 08:00:01 pm]
Threads - stringlist and ...
by
alpine
[
Today
at 07:48:24 pm]
BufferData not let appen...
by
eldonfsr
[
Today
at 07:28:55 pm]
Anonymous Unions-Middle R...
by
jamie
[
Today
at 07:07:30 pm]
TFPGObjectList and custom...
by
Thaddy
[
Today
at 05:50:31 pm]
Routine to array all fold...
by
BobDog
[
Today
at 05:39:07 pm]
Best way to delete an ins...
by
Handoko
[
Today
at 05:35:49 pm]
MacOS - Chess256.lpr(88,3...
by
tearsfornations
[
Today
at 05:08:37 pm]
Bluetooth on Raspberry, d...
by
Thaddy
[
Today
at 03:36:43 pm]
Cut files to Clipboard (i...
by
domasz
[
Today
at 02:48:19 pm]
OnMouseDown - How catch g...
by
jamie
[
Today
at 02:07:29 pm]
xlsreader package
by
ronhud
[
Today
at 01:39:13 pm]
COUNTIF is case sensitive...
by
fred
[
Today
at 01:33:38 pm]
Dialogue FileOpen positio...
by
marcio2003
[
Today
at 12:23:17 pm]
How to use customize outp...
by
Martin_fr
[
Today
at 11:22:53 am]
Dark mode in app - white ...
by
d7_2_laz
[
Today
at 11:19:18 am]
Tips for deep debuging of...
by
Martin_fr
[
Today
at 10:43:50 am]
Installing Lazarus on Lin...
by
fmarulaz
[
Today
at 09:35:00 am]
lhelp not working on Linu...
by
dbannon
[
Today
at 07:06:47 am]
help choosing laptop
by
Handoko
[
Today
at 04:56:38 am]
LAMW - simple esc/POS pri...
by
Mongkey
[
Today
at 04:11:12 am]
[TLineSeries] Slow Prepar...
by
Martok
[
Today
at 01:11:28 am]
Fpcupdeluxe
by
Awkward
[May 28, 2023, 08:56:04 pm]
« previous
next »
Print
Pages: [
1
]
Author
Topic: StrComp problem(Solved) (Read 253 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