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
Suggestion on the lines o...
by
Skvoznjak
[
Today
at 04:50:27 pm]
Feature announcement: Fun...
by
Thaddy
[
Today
at 04:50:03 pm]
Check for updates and upd...
by
Thaddy
[
Today
at 04:43:16 pm]
program locks up using se...
by
cdbc
[
Today
at 04:05:44 pm]
Testers needed: FpDebug a...
by
Martin_fr
[
Today
at 03:27:07 pm]
Scope of cross-platform
by
egsuh
[
Today
at 03:23:54 pm]
How to download a file fr...
by
maurobio
[
Today
at 03:07:38 pm]
What to change ModePortA,...
by
pascalbythree
[
Today
at 01:40:17 pm]
Making a little chart app
by
circular
[
Today
at 01:23:15 pm]
.cvd ClamAV database comp...
by
Turkeytmfounder
[
Today
at 01:21:52 pm]
[RESOLVED] bug in FpWait?
by
robert rozee
[
Today
at 01:04:36 pm]
Can't place ATBinHex on f...
by
GetMem
[
Today
at 12:50:08 pm]
Best way to include lots ...
by
PascalDragon
[
Today
at 12:43:17 pm]
Are We Dead Yet?
by
PascalDragon
[
Today
at 12:38:59 pm]
Lazarus for RISC OS
by
PascalDragon
[
Today
at 12:26:48 pm]
Search in files
by
d7_2_laz
[
Today
at 11:43:33 am]
virtualdbtreeex
by
Pe3s
[
Today
at 11:06:36 am]
Fill dual brush color in ...
by
wp
[
Today
at 10:48:05 am]
[Closed] Holding form pos...
by
Bart
[
Today
at 09:45:09 am]
Tools I made for my needs
by
zeljkoc
[
Today
at 05:20:14 am]
Lazarus 2.2.6 can't insta...
by
eldonfsr
[
Today
at 04:57:33 am]
May be an fpc issue
by
Curt Carpenter
[June 07, 2023, 09:52:49 pm]
Something wrong when i cl...
by
eljo
[June 07, 2023, 09:31:49 pm]
DBEdit - display setting ...
by
rvk
[June 07, 2023, 09:29:46 pm]
How to setup Exception-Ha...
by
ASerge
[June 07, 2023, 08:48:55 pm]
« previous
next »
Print
Pages: [
1
]
Author
Topic: StrComp problem(Solved) (Read 276 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