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
Forum Rules
About donations (wiki)
Bookstore
Computer Math and Games in Pascal
(preview)
Lazarus Handbook
Search
Advanced search
Recent
Strange behavior with dat...
by
JanRoza
[
Today
at 05:58:26 pm]
Track windows cross-platf...
by
LemonParty
[
Today
at 05:37:47 pm]
RegExpr matchting empty s...
by
Thaddy
[
Today
at 04:35:27 pm]
Remote desktop software i...
by
rvk
[
Today
at 04:25:06 pm]
TLazSerial : serial port ...
by
CM630
[
Today
at 03:45:42 pm]
Little bit...
by
jamie
[
Today
at 03:42:58 pm]
Omitting semicolon on las...
by
Xenno
[
Today
at 02:46:07 pm]
Can't pass string to TEdi...
by
lazarusprogrammer
[
Today
at 02:04:36 pm]
Messing with Gemini AI an...
by
gidesa
[
Today
at 12:48:03 pm]
Lazarus Bugfix Release 4....
by
dbannon
[
Today
at 10:09:07 am]
FPC Unleashed (inline var...
by
440bx
[
Today
at 10:03:41 am]
[ANN] Unofficial FPC 3.3....
by
PascalDragon
[
Today
at 07:37:59 am]
[SOLVED] How to enter gen...
by
PascalDragon
[
Today
at 07:27:12 am]
AI Assist Python - to - P...
by
PascalDragon
[
Today
at 07:25:42 am]
How to remove a FORM from...
by
Martin_fr
[
Today
at 12:29:46 am]
504 Gateway Timeout
by
Marc
[April 09, 2026, 10:28:28 pm]
Can /my/ AI help me with ...
by
schuler
[April 09, 2026, 09:27:43 pm]
I can write your README.m...
by
schuler
[April 09, 2026, 09:22:38 pm]
Hang
by
Handoko
[April 09, 2026, 05:42:39 pm]
Closing application when ...
by
LeP
[April 09, 2026, 03:14:32 pm]
VST scale bug?
by
Espectr0
[April 09, 2026, 02:09:55 pm]
bomber command (inc)
by
speter
[April 09, 2026, 02:32:37 am]
[FPC 3.2.4, Windows] PTC ...
by
Roland57
[April 08, 2026, 08:17:27 pm]
Abbrevia extract failed
by
wp
[April 08, 2026, 06:15:29 pm]
Which quantized model wor...
by
gidesa
[April 08, 2026, 06:14:16 pm]
« previous
next »
Print
Pages: [
1
]
Author
Topic: The variant part of the record is always public (Read 1471 times)
ASerge
Hero Member
Posts: 2480
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: 18911
Glad to be alive.
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
Recovered from removal of tumor in tongue following tongue reconstruction with a part from my leg.
ASerge
Hero Member
Posts: 2480
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