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
How to download a file fr...
by
jmpessoa
[
Today
at 10:13:41 pm]
May be an fpc issue
by
Curt Carpenter
[
Today
at 09:52:49 pm]
Something wrong when i cl...
by
eljo
[
Today
at 09:31:49 pm]
DBEdit - display setting ...
by
rvk
[
Today
at 09:29:46 pm]
Tools I made for my needs
by
eljo
[
Today
at 09:27:23 pm]
Search in files
by
d7_2_laz
[
Today
at 09:21:14 pm]
How to setup Exception-Ha...
by
ASerge
[
Today
at 08:48:55 pm]
Lazarus for RISC OS
by
StefanRISCOS
[
Today
at 08:17:46 pm]
Best way to include lots ...
by
Nicole
[
Today
at 08:12:01 pm]
Insert variant array to e...
by
Nicole
[
Today
at 08:09:05 pm]
Changes in "Search Result...
by
n7800
[
Today
at 07:25:10 pm]
Filter improvments for "S...
by
n7800
[
Today
at 07:00:53 pm]
[Solved] Can I use a font...
by
furious programming
[
Today
at 05:29:19 pm]
Lazarus 2.2.6 can't insta...
by
wp
[
Today
at 04:47:10 pm]
Feature announcement: Fun...
by
Peter H
[
Today
at 03:31:58 pm]
SQLITE3: TSQLQuery fails ...
by
upsidasi
[
Today
at 03:24:50 pm]
[SOLVED] IDE freezing on ...
by
maurobio
[
Today
at 02:25:15 pm]
ODBC System DSN connected...
by
LacaK
[
Today
at 02:18:22 pm]
structured types structur...
by
Чебурашка
[
Today
at 01:31:09 pm]
Access violation with use...
by
Martin_fr
[
Today
at 12:55:49 pm]
[SOLVED] How to send line...
by
Slawek
[
Today
at 12:08:07 pm]
Cannot connect to MariaDB...
by
TRon
[
Today
at 11:10:35 am]
[solved] FPCUpdeluxe erro...
by
TRon
[
Today
at 10:36:10 am]
A flag problem? [SOLVED]
by
Badger
[
Today
at 09:33:21 am]
program locks up using se...
by
TRon
[
Today
at 09:12:52 am]
« previous
next »
Print
Pages: [
1
]
Author
Topic: StrComp problem(Solved) (Read 274 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: 1403
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