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
IDE freezing on opening p...
by
JuhaManninen
[
Today
at 01:55:49 am]
Windows on ARM64
by
Wallaby
[
Today
at 01:36:51 am]
Are We Dead Yet?
by
dieselnutjob
[
Today
at 12:58:56 am]
Something wrong when i cl...
by
tetrastes
[
Today
at 12:52:42 am]
Changes in "Search Result...
by
n7800
[
Today
at 12:46:58 am]
[SOLVED] Notice: procedur...
by
wp
[
Today
at 12:38:12 am]
program locks up using se...
by
dieselnutjob
[
Today
at 12:26:40 am]
[SOLVED] What does TSQLCo...
by
Slawek
[June 06, 2023, 11:53:55 pm]
[SOLVED] How to send line...
by
Slawek
[June 06, 2023, 11:23:12 pm]
Feature announcement: Fun...
by
Peter H
[June 06, 2023, 11:17:10 pm]
CoWaitForMultipleObjects ...
by
runewalsh
[June 06, 2023, 10:30:48 pm]
IInterface issues, compil...
by
PascalDragon
[June 06, 2023, 10:27:36 pm]
Lazarus for RISC OS
by
PascalDragon
[June 06, 2023, 09:59:21 pm]
[solved] FPCUpdeluxe erro...
by
KodeZwerg
[June 06, 2023, 09:58:04 pm]
[RESOLVED] bug in FpWait?
by
PascalDragon
[June 06, 2023, 09:50:06 pm]
Small DBMS project and Ho...
by
cdbc
[June 06, 2023, 09:37:50 pm]
Does FPC uses any interme...
by
mercurhyo
[June 06, 2023, 09:27:44 pm]
[SOLVED] DBGrid icon
by
Pe3s
[June 06, 2023, 06:26:05 pm]
TMEMO How to get line of ...
by
rvk
[June 06, 2023, 04:17:18 pm]
How to make a T[Flow]Pane...
by
pleumann
[June 06, 2023, 02:43:49 pm]
Error in Sway
by
Bad Sector
[June 06, 2023, 02:41:49 pm]
High DPI questions
by
Luc
[June 06, 2023, 02:17:04 pm]
How to download a file fr...
by
maurobio
[June 06, 2023, 01:26:32 pm]
Cannot connect to MariaDB...
by
marsupilami79
[June 06, 2023, 12:51:24 pm]
Online Package Manager
by
GetMem
[June 06, 2023, 10:34:41 am]
« previous
next »
Print
Pages: [
1
]
Author
Topic: StrComp problem(Solved) (Read 271 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: 1402
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