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
Scope of cross-platform
by
Wallaby
[
Today
at 02:22:41 am]
Feature announcement: Fun...
by
Peter H
[
Today
at 01:00:58 am]
Connect Bluetooth Chess b...
by
tearsfornations
[
Today
at 12:44:06 am]
Are We Dead Yet?
by
dieselnutjob
[
Today
at 12:35:09 am]
program locks up using se...
by
dieselnutjob
[
Today
at 12:31:35 am]
How to download a file fr...
by
maurobio
[
Today
at 12:25:09 am]
How to POST a SOAPAction ...
by
rvk
[
Today
at 12:12:23 am]
is it possible to create ...
by
andyf97
[
Today
at 12:04:07 am]
Check for updates and upd...
by
lainz
[June 08, 2023, 10:27:12 pm]
What to change ModePortA,...
by
ccrause
[June 08, 2023, 10:17:09 pm]
Small DBMS project and Ho...
by
Researching
[June 08, 2023, 09:53:35 pm]
Access violation with use...
by
Martin_fr
[June 08, 2023, 08:34:18 pm]
Suggestion on the lines o...
by
Skvoznjak
[June 08, 2023, 06:43:43 pm]
Best way to include lots ...
by
PascalDragon
[June 08, 2023, 06:14:51 pm]
.cvd ClamAV database comp...
by
PascalDragon
[June 08, 2023, 06:09:43 pm]
DBEdit - display setting ...
by
rvk
[June 08, 2023, 05:44:34 pm]
[SOLVED] Help for downloa...
by
magleft
[June 08, 2023, 05:02:48 pm]
Testers needed: FpDebug a...
by
Martin_fr
[June 08, 2023, 03:27:07 pm]
Making a little chart app
by
circular
[June 08, 2023, 01:23:15 pm]
[RESOLVED] bug in FpWait?
by
robert rozee
[June 08, 2023, 01:04:36 pm]
Can't place ATBinHex on f...
by
GetMem
[June 08, 2023, 12:50:08 pm]
Lazarus for RISC OS
by
PascalDragon
[June 08, 2023, 12:26:48 pm]
Search in files
by
d7_2_laz
[June 08, 2023, 11:43:33 am]
virtualdbtreeex
by
Pe3s
[June 08, 2023, 11:06:36 am]
Fill dual brush color in ...
by
wp
[June 08, 2023, 10:48:05 am]
« previous
next »
Print
Pages: [
1
]
Author
Topic: StrComp problem(Solved) (Read 278 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: 1404
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