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
Hole punching - Step by S...
by
Key-Real
[
Today
at 11:54:54 am]
LazPaint (alpha-blending,...
by
circular
[
Today
at 11:49:46 am]
Changes in "Search Result...
by
Martin_fr
[
Today
at 11:44:47 am]
Touchscreen selecting rec...
by
Jon Trepte
[
Today
at 11:44:03 am]
Would folks find these mi...
by
wp
[
Today
at 11:42:15 am]
Clean up at ide/include/i...
by
JuhaManninen
[
Today
at 11:34:06 am]
Are We Dead Yet?
by
Warfley
[
Today
at 11:26:52 am]
Default and speed effect
by
Okoba
[
Today
at 11:13:49 am]
Code clean up at TFontMan...
by
wp
[
Today
at 11:09:11 am]
Why is the rectangle the ...
by
Tomi
[
Today
at 10:56:24 am]
SQLite check if record ex...
by
Чебурашка
[
Today
at 10:45:38 am]
PostgreSQL: typeinfo erro...
by
SymbolicFrank
[
Today
at 10:31:23 am]
How to use the Event Log?
by
WooBean
[
Today
at 09:13:35 am]
[SOLVED] SQLite Unique
by
Pe3s
[
Today
at 09:00:12 am]
Help for downloand file
by
Jurassic Pork
[
Today
at 08:33:10 am]
Letters chopped off in hi...
by
cdbc
[
Today
at 07:48:46 am]
how to download fulling f...
by
greenzyzyzy
[
Today
at 04:12:30 am]
help choosing laptop
by
Weiss
[
Today
at 03:11:56 am]
using the create_lazarus_...
by
jshand2010
[
Today
at 02:01:04 am]
LAMW - simple esc/POS pri...
by
jmpessoa
[
Today
at 01:51:58 am]
Installing GDB on MAC OS ...
by
Martin_fr
[
Today
at 01:49:44 am]
Is Meta programming possi...
by
Joanna
[May 31, 2023, 11:57:27 pm]
[Solved] Dark mode in app...
by
d7_2_laz
[May 31, 2023, 11:28:56 pm]
How to download a file fr...
by
c4p
[May 31, 2023, 10:09:56 pm]
Magic, non referenced var...
by
PascalDragon
[May 31, 2023, 09:55:09 pm]
« previous
next »
Print
Pages: [
1
]
Author
Topic: StrComp problem(Solved) (Read 255 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: 1396
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