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
LAMW - simple esc/POS pri...
by
Mongkey
[
Today
at 12:20:54 am]
Who uses "caret past EOL"...
by
Bart
[June 02, 2023, 11:31:22 pm]
Clean up at ide/include/i...
by
Bart
[June 02, 2023, 11:10:05 pm]
Fast Base64 encoding/deco...
by
mika
[June 02, 2023, 10:53:10 pm]
discarding an array
by
PascalDragon
[June 02, 2023, 10:51:57 pm]
if then else syntax
by
Kays
[June 02, 2023, 10:45:08 pm]
array of array of type?
by
PascalDragon
[June 02, 2023, 10:31:57 pm]
TSynEdit crashes when loa...
by
domasz
[June 02, 2023, 08:46:13 pm]
[SOLVED] Help for downloa...
by
magleft
[June 02, 2023, 08:30:34 pm]
help choosing laptop
by
Leledumbo
[June 02, 2023, 08:18:27 pm]
How to create form in thr...
by
Remy Lebeau
[June 02, 2023, 06:37:23 pm]
TStringGrid : Conflict be...
by
Nel_Fie
[June 02, 2023, 06:17:51 pm]
Changes in "Search Result...
by
Martin_fr
[June 02, 2023, 06:13:01 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]
ODBC System DSN connected...
by
Jonvy
[June 02, 2023, 03:46:19 pm]
Are We Dead Yet?
by
Warfley
[June 02, 2023, 02:32:43 pm]
[Solved] Letters chopped ...
by
jamie
[June 02, 2023, 01:15:30 pm]
Best way to delete an ins...
by
furious programming
[June 02, 2023, 12:57:26 pm]
first generic attempt
by
Paolo
[June 02, 2023, 11:11:04 am]
CEF dynamic library canno...
by
myisjwj
[June 02, 2023, 10:10:59 am]
lhelp not working on Linu...
by
marcov
[June 02, 2023, 09:09:08 am]
Browser Automation with s...
by
TRon
[June 02, 2023, 07:29:31 am]
help exporting 2 data col...
by
howardpc
[June 02, 2023, 06:32:47 am]
Rosetta Code Sutherland-H...
by
VTwin
[June 01, 2023, 11:58:31 pm]
« previous
next »
Print
Pages: [
1
]
Author
Topic: StrComp problem(Solved) (Read 258 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