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
Threads - stringlist and ...
by
Thaddy
[
Today
at 07:19:44 am]
Can't load because <x> de...
by
Thaddy
[
Today
at 07:02:45 am]
Are We Dead Yet?
by
Handoko
[
Today
at 06:29:30 am]
LAMW - simple esc/POS pri...
by
Mongkey
[
Today
at 02:46:21 am]
ZenGL +android + MacOS Co...
by
Seenkao
[
Today
at 02:34:38 am]
Insert variant array to e...
by
jamie
[
Today
at 01:28:28 am]
Providing *.deb files for...
by
Bi0T1N
[
Today
at 01:18:36 am]
Load local HTML file into...
by
maurobio
[May 27, 2023, 08:10:08 pm]
Non-local goto example ne...
by
Peter H
[May 27, 2023, 08:05:34 pm]
[SOLVED] Using high inste...
by
lagprogramming
[May 27, 2023, 07:50:48 pm]
LAMW - default manifest r...
by
jmpessoa
[May 27, 2023, 07:25:21 pm]
Improvements in rtl/objpa...
by
PascalDragon
[May 27, 2023, 06:35:26 pm]
Optimization of for loops...
by
lagprogramming
[May 27, 2023, 03:56:09 pm]
How to download a file fr...
by
maurobio
[May 27, 2023, 02:58:43 pm]
Solved- TSQLQuery.ExecSQL...
by
br4d
[May 27, 2023, 02:26:56 pm]
New version of BGRABitmap
by
circular
[May 27, 2023, 01:59:44 pm]
[Solved] Help with spellc...
by
Espectr0
[May 27, 2023, 12:04:11 pm]
first generic attempt
by
Martin_fr
[May 27, 2023, 11:47:41 am]
Hole punching - Step by S...
by
Key-Real
[May 27, 2023, 10:28:34 am]
[SOLVED] How to get recei...
by
cdbc
[May 27, 2023, 10:04:41 am]
Online Package Manager
by
circular
[May 27, 2023, 08:43:06 am]
Reading MAC address of Ac...
by
Jurassic Pork
[May 27, 2023, 07:56:41 am]
LAMW - How to build kitka...
by
jmpessoa
[May 27, 2023, 12:39:35 am]
Cut files to Clipboard (i...
by
jamie
[May 26, 2023, 11:13:16 pm]
Is Meta programming possi...
by
PascalDragon
[May 26, 2023, 10:14:46 pm]
« previous
next »
Print
Pages: [
1
]
Author
Topic: StrComp problem(Solved) (Read 250 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: 1395
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