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
Tmemo add char like typin...
by
CM630
[
Today
at 09:22:22 pm]
C operators and shift
by
PascalDragon
[
Today
at 09:06:32 pm]
ZUGFeRD: Which PDF lib to...
by
PascalDragon
[
Today
at 09:04:03 pm]
[SOLVED] Howto use a DEFI...
by
PascalDragon
[
Today
at 08:59:54 pm]
Python4Lazarus Undefined ...
by
AlexTP
[
Today
at 08:42:33 pm]
Map vs dataset
by
Packs
[
Today
at 07:12:40 pm]
Inversive Geometry Curves...
by
Dzandaa
[
Today
at 06:39:58 pm]
mxMarkEdit, a new visual ...
by
maxnd
[
Today
at 06:08:17 pm]
kernel 6.8 and checking s...
by
MarkMLl
[
Today
at 06:04:53 pm]
How much would it hamper ...
by
Martin_fr
[
Today
at 05:01:02 pm]
Api/component pack for Ra...
by
MarkMLl
[
Today
at 04:47:33 pm]
compiler messages suggest...
by
Thaddy
[
Today
at 04:15:17 pm]
Wrong resolution of secon...
by
Apiglio
[
Today
at 03:13:47 pm]
Benchmarks
by
Warfley
[
Today
at 02:00:39 pm]
Breakpoint dosn't work
by
Martin_fr
[
Today
at 01:13:30 pm]
[Solved]I have created dl...
by
Packs
[
Today
at 01:11:27 pm]
TLazSerial : serial port ...
by
tetrastes
[
Today
at 12:26:29 pm]
Common File Dialogs Have ...
by
rvk
[
Today
at 10:39:59 am]
Bright color
by
Warfley
[
Today
at 10:29:06 am]
[Solved] pointer to out o...
by
440bx
[
Today
at 12:51:22 am]
storing string
by
ASerge
[December 04, 2024, 11:06:57 pm]
Show Form at Top
by
n7800
[December 04, 2024, 10:16:21 pm]
Arrow keys in FV
by
HotShoe
[December 04, 2024, 10:04:56 pm]
"Active $IFDEF code" is r...
by
MarkMLl
[December 04, 2024, 09:49:15 pm]
NSHapticFeedbackPerformer
by
msintle
[December 04, 2024, 09:47:25 pm]
« previous
next »
Print
Pages: [
1
]
Author
Topic: The variant part of the record is always public (Read 1004 times)
ASerge
Hero Member
Posts: 2337
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: 16158
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: 2337
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