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
Access violation with use...
by
Martin_fr
[
Today
at 06:56:10 pm]
How to download a file fr...
by
c4p
[
Today
at 06:34:13 pm]
Feature announcement: Fun...
by
Thaddy
[
Today
at 06:07:01 pm]
.cvd ClamAV database comp...
by
af0815
[
Today
at 05:49:18 pm]
LADSPA for FP. Anyone int...
by
commanderz
[
Today
at 05:41:40 pm]
IDE shows wrong Error Mes...
by
Martin_fr
[
Today
at 05:28:28 pm]
CURL throws Error CURLE_R...
by
Hartmut
[
Today
at 05:16:39 pm]
program locks up using se...
by
cdbc
[
Today
at 04:44:55 pm]
Generic array of records ...
by
paweld
[
Today
at 04:42:14 pm]
list of IT assets
by
eljo
[
Today
at 04:39:50 pm]
Is changing name supposed...
by
Martin_fr
[
Today
at 03:56:21 pm]
Can't place ATBinHex on f...
by
domasz
[
Today
at 03:26:03 pm]
Why is a private type of ...
by
Thaddy
[
Today
at 03:25:45 pm]
Lazarus 2.2.6 and anchord...
by
Soner
[
Today
at 01:28:21 pm]
Testers needed: FpDebug a...
by
nanobit
[
Today
at 01:26:41 pm]
is it possible to create ...
by
Seenkao
[
Today
at 11:17:33 am]
Possible work-around for ...
by
Thaddy
[
Today
at 10:13:31 am]
Small DBMS project and Ho...
by
TRon
[
Today
at 07:44:06 am]
Check for updates and upd...
by
KodeZwerg
[
Today
at 07:43:19 am]
python for lazarus
by
Mongkey
[
Today
at 06:23:44 am]
Scope of cross-platform
by
TRon
[
Today
at 06:07:59 am]
Something wrong when i cl...
by
TRon
[
Today
at 05:57:57 am]
Connect Bluetooth Chess b...
by
tearsfornations
[
Today
at 05:48:10 am]
Lazarus for RISC OS
by
TRon
[
Today
at 05:36:04 am]
Are We Dead Yet?
by
dieselnutjob
[
Today
at 12:35:09 am]
« previous
next »
Print
Pages: [
1
]
Author
Topic: StrComp problem(Solved) (Read 279 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: 1405
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