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
discarding an array
by
jamie
[
Today
at 09:08:33 pm]
Are We Dead Yet?
by
440bx
[
Today
at 08:34:44 pm]
How to download a file fr...
by
maurobio
[
Today
at 08:32:29 pm]
LAMW BackButton not worki...
by
maurobio
[
Today
at 08:24:09 pm]
Changes in "Search Result...
by
JuhaManninen
[
Today
at 07:37:55 pm]
How to create form in thr...
by
PascalDragon
[
Today
at 07:22:32 pm]
Who uses "caret past EOL"...
by
Martin_fr
[
Today
at 06:34:39 pm]
any one knows how to set ...
by
greenzyzyzy
[
Today
at 05:17:51 pm]
array of array of type?
by
jamie
[
Today
at 04:42:22 pm]
if then else syntax
by
jamie
[
Today
at 04:37:44 pm]
how to do a HTTP POST wit...
by
rvk
[
Today
at 03:51:05 pm]
[SOLVED] SynEdit resize t...
by
Hansvb
[
Today
at 03:42:16 pm]
Clean up at ide/include/i...
by
Warfley
[
Today
at 12:29:46 pm]
[SOLVED] Help for downloa...
by
magleft
[
Today
at 11:32:31 am]
Two issues related to fcl...
by
wp
[
Today
at 11:07:07 am]
ANN: ODBC DAC under GNU G...
by
Andrey Zubik
[
Today
at 01:14:38 am]
LAMW - (SOLVED) simple es...
by
Mongkey
[
Today
at 12:20:54 am]
Fast Base64 encoding/deco...
by
mika
[June 02, 2023, 10:53:10 pm]
TSynEdit crashes when loa...
by
domasz
[June 02, 2023, 08:46:13 pm]
help choosing laptop
by
Leledumbo
[June 02, 2023, 08:18:27 pm]
TStringGrid : Conflict be...
by
Nel_Fie
[June 02, 2023, 06:17:51 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]
[Solved] Letters chopped ...
by
jamie
[June 02, 2023, 01:15:30 pm]
« previous
next »
Print
Pages: [
1
]
Author
Topic: StrComp problem(Solved) (Read 261 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