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
Changes in "Search Result...
by
JuhaManninen
[
Today
at 05:10:44 pm]
How do I set these packag...
by
BSaidus
[
Today
at 05:01:08 pm]
How to connect from Inter...
by
mercurhyo
[
Today
at 04:59:20 pm]
Who uses "caret past EOL"...
by
eljo
[
Today
at 04:30:25 pm]
array of array of type?
by
xixixi
[
Today
at 03:49:29 pm]
ODBC System DSN connected...
by
Jonvy
[
Today
at 03:46:19 pm]
Fast Base64 encoding/deco...
by
mikerabat
[
Today
at 02:53:39 pm]
Are We Dead Yet?
by
Warfley
[
Today
at 02:32:43 pm]
Clean up at ide/include/i...
by
Thaddy
[
Today
at 01:55:37 pm]
[Solved] Letters chopped ...
by
jamie
[
Today
at 01:15:30 pm]
Best way to delete an ins...
by
furious programming
[
Today
at 12:57:26 pm]
LAMW - simple esc/POS pri...
by
Mongkey
[
Today
at 11:20:00 am]
first generic attempt
by
Paolo
[
Today
at 11:11:04 am]
CEF dynamic library canno...
by
myisjwj
[
Today
at 10:10:59 am]
lhelp not working on Linu...
by
marcov
[
Today
at 09:09:08 am]
Browser Automation with s...
by
TRon
[
Today
at 07:29:31 am]
help exporting 2 data col...
by
howardpc
[
Today
at 06:32:47 am]
How to create form in thr...
by
lazpas
[
Today
at 03:28:54 am]
Rosetta Code Sutherland-H...
by
VTwin
[June 01, 2023, 11:58:31 pm]
if then else syntax
by
eljo
[June 01, 2023, 11:49:40 pm]
Make a part of text of a ...
by
vico
[June 01, 2023, 11:49:09 pm]
Tips for deep debuging of...
by
Martin_fr
[June 01, 2023, 11:37:12 pm]
Making a little chart app
by
wp
[June 01, 2023, 10:59:56 pm]
Code clean up at TFontMan...
by
PascalDragon
[June 01, 2023, 10:41:48 pm]
discarding an array
by
PascalDragon
[June 01, 2023, 10:29:14 pm]
« previous
next »
Print
Pages: [
1
]
Author
Topic: StrComp problem(Solved) (Read 257 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