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
Nested declarations insid...
by
Joanna from IRC
[
Today
at 02:46:20 am]
File operations blocking ...
by
atlatl
[
Today
at 01:12:50 am]
const declaration
by
Joanna from IRC
[
Today
at 12:42:02 am]
Hustle - A simple task ma...
by
Wesbat
[
Today
at 12:24:34 am]
FP crashes after running ...
by
Martin_fr
[
Today
at 12:15:57 am]
VGM Player
by
Gigatron2
[
Today
at 12:03:16 am]
TImage colors incorrect
by
Jonny
[January 14, 2025, 11:27:29 pm]
SDL2 image rotation Probl...
by
Fred vS
[January 14, 2025, 11:18:08 pm]
[SOLVED]Might have a menu...
by
Tony Stone
[January 14, 2025, 10:39:56 pm]
H2Pas can't handle EXP CA...
by
Dibo
[January 14, 2025, 10:30:23 pm]
Troubles when converting ...
by
CM630
[January 14, 2025, 09:58:53 pm]
Batch "publish" of all pr...
by
n7800
[January 14, 2025, 09:39:08 pm]
/lib/x86_64-linux-gnu/lib...
by
DonAlfredo
[January 14, 2025, 09:00:28 pm]
SDL2: Runtime Error 216 o...
by
mischi
[January 14, 2025, 08:05:51 pm]
Iterator on non-existing ...
by
TRon
[January 14, 2025, 07:55:00 pm]
how to find application r...
by
bytebites
[January 14, 2025, 07:49:23 pm]
Out of memory / filter tw...
by
Thaddy
[January 14, 2025, 07:23:20 pm]
test if web site is valid
by
Thaddy
[January 14, 2025, 06:51:18 pm]
Quantize a PNG with TBgra...
by
circular
[January 14, 2025, 05:54:45 pm]
[SOLVED] Highlight commen...
by
artem101
[January 14, 2025, 05:19:04 pm]
Lazarus Release 3.6
by
Fred vS
[January 14, 2025, 03:23:01 pm]
CADSys4 3D.
by
mdadali
[January 14, 2025, 02:53:57 pm]
Color Buttons
by
lainz
[January 14, 2025, 01:04:56 pm]
Repository mirror and Ind...
by
Marc
[January 14, 2025, 12:27:48 pm]
Fpc Updates
by
loaded
[January 14, 2025, 12:19:36 pm]
« previous
next »
Print
Pages: [
1
]
Author
Topic: The variant part of the record is always public (Read 1082 times)
ASerge
Hero Member
Posts: 2351
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: 16312
Censorship about opinions does not belong here.
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
If I smell bad code it usually is bad code and that includes my own code.
ASerge
Hero Member
Posts: 2351
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