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