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
¿Hay alguna limitación en...
by
e_nigma
[
Today
at 06:21:46 pm]
file Blockread error
by
jamie
[
Today
at 06:17:26 pm]
Random ?
by
Zoran
[
Today
at 06:12:53 pm]
Exploring FPC/Lazarus uni...
by
MarkMLl
[
Today
at 05:48:05 pm]
Web Pascal without JavaSc...
by
zendrael
[
Today
at 05:19:57 pm]
SDL2 image rotation Probl...
by
Pe3s
[
Today
at 05:07:24 pm]
Color Buttons
by
lainz
[
Today
at 04:20:28 pm]
MainMenu: How to use the ...
by
madref
[
Today
at 03:03:37 pm]
Why with allows assignmen...
by
Warfley
[
Today
at 02:49:58 pm]
How to combine data from ...
by
Thaddy
[
Today
at 02:30:11 pm]
SDL2: Runtime Error 216 o...
by
mischi
[
Today
at 02:11:35 pm]
how to create sync applic...
by
Khrys
[
Today
at 02:08:11 pm]
Might have a menu bug in ...
by
cdbc
[
Today
at 01:46:12 pm]
Nested declarations insid...
by
Warfley
[
Today
at 01:45:20 pm]
Vulnerabilities lurking i...
by
tetrastes
[
Today
at 12:51:20 pm]
TSQLquery does not save a...
by
egsuh
[
Today
at 11:53:54 am]
Lazarus Release Candidate...
by
pleumann
[
Today
at 11:39:03 am]
How to validate ParamStr(...
by
Thaddy
[
Today
at 11:22:51 am]
Generics as PUBLISHED imp...
by
YetAnotherDelphiLeaver
[
Today
at 11:21:20 am]
how to make application r...
by
Thaddy
[
Today
at 11:14:02 am]
[SOLVED] Unwanted additio...
by
CM630
[
Today
at 08:32:42 am]
ЛазМер/ LazMer for measur...
by
CM630
[
Today
at 08:22:23 am]
Compile auxilliary units ...
by
Wesbat
[
Today
at 08:17:22 am]
Lazarus Pascal Keywords a...
by
dbannon
[
Today
at 05:34:52 am]
New old guy
by
TBMan
[
Today
at 04:00:47 am]
« previous
next »
Print
Pages: [
1
]
Author
Topic: The variant part of the record is always public (Read 1080 times)
ASerge
Hero Member
Posts: 2347
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: 16300
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: 2347
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