Lazarus
Home
Help
TinyPortal
Search
Login
Register
Lazarus
»
Forum
»
Free Pascal
»
FPC development
(Moderators:
FPK
,
Tomas Hajny
) »
The variant part of the record is always public
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
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 do you update a file ...
by
EganSolo
[
Today
at 02:56:52 am]
LazPaint (alpha-blending,...
by
lainz
[
Today
at 02:01:55 am]
how to break out early of...
by
munair
[
Today
at 01:53:35 am]
Survey: effect of the new...
by
Martin_fr
[
Today
at 01:27:41 am]
Lazarus Release 4.0
by
Bart
[
Today
at 12:24:18 am]
Little Red Riding Hood (t...
by
Lulu
[May 24, 2025, 11:04:07 pm]
DeleteDirectory doesn't a...
by
ASerge
[May 24, 2025, 10:46:53 pm]
AnchorDocking in my app
by
Fred vS
[May 24, 2025, 10:32:31 pm]
[Solved] Learn how to (un...
by
Hansvb
[May 24, 2025, 08:44:26 pm]
string argument as array ...
by
jamie
[May 24, 2025, 08:26:49 pm]
compilerproc Problem by u...
by
paule32
[May 24, 2025, 07:53:37 pm]
New version of BGRABitmap
by
circular
[May 24, 2025, 07:53:02 pm]
LAMW arduino serial comm ...
by
jmpessoa
[May 24, 2025, 07:38:54 pm]
problem with scrollbox
by
rcmz
[May 24, 2025, 06:37:56 pm]
SynEdit
by
Martin_fr
[May 24, 2025, 06:27:48 pm]
MacOS intel : Lazarus-dar...
by
Selzig
[May 24, 2025, 05:58:28 pm]
I can write your README.m...
by
wp
[May 24, 2025, 05:31:52 pm]
Daraja HTTP Framework 3.0...
by
mjustin
[May 24, 2025, 05:16:20 pm]
my programs crash
by
turunk
[May 24, 2025, 02:54:49 pm]
Looking for industrial pa...
by
krolikbest
[May 24, 2025, 01:45:55 pm]
WM_ message List for dest...
by
paule32
[May 24, 2025, 01:43:04 pm]
FPC 3.3.1 release date an...
by
Martin_fr
[May 24, 2025, 01:08:18 pm]
I lost in Code ...
by
cdbc
[May 24, 2025, 01:00:56 pm]
Feature request/suggestio...
by
440bx
[May 24, 2025, 12:35:16 pm]
[solved] how to post a po...
by
Nicole
[May 24, 2025, 12:12:45 pm]
« previous
next »
Print
Pages: [
1
]
Author
Topic: The variant part of the record is always public (Read 1250 times)
ASerge
Hero Member
Posts: 2413
The variant part of the record is always public
«
on:
June 15, 2024, 04:45:35 pm »
Code: Pascal
[Select]
[+]
[-]
{$MODE OBJFPC}
{$MODESWITCH ADVANCEDRECORDS}
type
TRec
=
record
strict
private
case
Selector
:
Byte
of
1
:
(
PartInt
:
Integer
)
;
2
:
(
PartBool
:
Boolean
)
;
end
;
var
R
:
TRec
;
begin
//R.Selector := 1; // project1.lpr(15,5) Error: identifier idents no member "Selector"
R
.
PartInt
:
=
55
;
// No error
end
.
Please test this in the latest version of Delphi, is it the same in it?
Logged
Thaddy
Hero Member
Posts: 16994
Ceterum censeo Trump esse delendam
Re: The variant part of the record is always public
«
Reply #1 on:
June 16, 2024, 08:54:47 am »
Delphi 11 errors as it should.
Logged
Due to censorship, I changed this to "Nelly the Elephant". Keeps the message clear.
ASerge
Hero Member
Posts: 2413
Re: The variant part of the record is always public
«
Reply #2 on:
June 16, 2024, 02:14:54 pm »
Quote from: Thaddy on June 16, 2024, 08:54:47 am
Delphi 11 errors as it should.
Thanks.
https://gitlab.com/freepascal.org/fpc/source/-/issues/40824
Logged
Print
Pages: [
1
]
« previous
next »
Lazarus
»
Forum
»
Free Pascal
»
FPC development
(Moderators:
FPK
,
Tomas Hajny
) »
The variant part of the record is always public
TinyPortal
© 2005-2018