Lazarus
Home
Help
TinyPortal
Search
Login
Register
Lazarus
»
Forum
»
Programming
»
General
»
When a public variable can not be assigned?
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
Interesting article about...
by
Khrys
[
Today
at 03:29:58 pm]
SAVE StringGrid to PDF
by
seghele0
[
Today
at 03:24:43 pm]
I need advice for a new c...
by
wp
[
Today
at 03:18:11 pm]
Adding interfaces to any ...
by
cdbc
[
Today
at 02:35:44 pm]
Controlled Folder Access
by
Igor Kokarev
[
Today
at 02:17:46 pm]
Wiki, a dead link in page...
by
d7_2_laz
[
Today
at 02:06:14 pm]
Datatypes Interoperabilit...
by
silvercoder70
[
Today
at 01:32:48 pm]
Notepad++ plugin with doc...
by
d7_2_laz
[
Today
at 01:11:52 pm]
DBLookupListBox shows (ME...
by
Zvoni
[
Today
at 12:26:03 pm]
how to control the order ...
by
cdbc
[
Today
at 12:15:39 pm]
Online tutor using remote...
by
Handoko
[
Today
at 11:57:40 am]
ZDataset.Locate + loParti...
by
silvercoder70
[
Today
at 10:49:08 am]
SQLite3 Date Problem
by
silvercoder70
[
Today
at 10:08:07 am]
Record "inheritance"/stru...
by
Thaddy
[
Today
at 09:54:38 am]
D2Bridge Framework for La...
by
egsuh
[
Today
at 04:48:02 am]
Application deployment
by
cousinp
[
Today
at 04:28:36 am]
[SOLVED] FPSpreadSheet, ...
by
TRon
[
Today
at 01:25:51 am]
Is it possible to do git ...
by
TRon
[
Today
at 12:41:39 am]
had a question and found ...
by
TRon
[
Today
at 12:36:57 am]
Draw Transparent Fill Rec...
by
LBox
[
Today
at 12:00:51 am]
MIDI commands
by
TRon
[December 09, 2024, 10:43:22 pm]
Who catches the Linux sig...
by
LV
[December 09, 2024, 09:47:15 pm]
FreePascal version of gcc...
by
PascalDragon
[December 09, 2024, 09:45:02 pm]
Lazarus for Windows on aa...
by
PascalDragon
[December 09, 2024, 09:21:38 pm]
ColorDialog can have opti...
by
Bart
[December 09, 2024, 06:07:24 pm]
« previous
next »
Print
Pages: [
1
]
Author
Topic: When a public variable can not be assigned? (Read 4012 times)
cpalx
Hero Member
Posts: 753
When a public variable can not be assigned?
«
on:
July 22, 2010, 08:37:02 pm »
hello
my question is?
if i have a public variable in a class, when this variable is readonly ??
Logged
theo
Global Moderator
Hero Member
Posts: 1930
Re: When a public variable can not be assigned?
«
Reply #1 on:
July 22, 2010, 09:07:56 pm »
if you mean a field in the public section: afaik never.
Logged
JD
Hero Member
Posts: 1848
Re: When a public variable can not be assigned?
«
Reply #2 on:
July 22, 2010, 11:08:33 pm »
Quote from: cpalx on July 22, 2010, 08:37:02 pm
hello
my question is?
if i have a public variable in a class, when this variable is readonly ??
A public variable by definition cannot be read only as far as I know. If you want a read only value, use constants instead. Constants cannot be changed & the compiler will throw an exception if you try to do so.
Logged
Windows - Lazarus 2.1/FPC 3.2 (built using fpcupdeluxe),
Linux Mint - Lazarus 2.1/FPC 3.2 (built using fpcupdeluxe)
mORMot; Zeos 8; SQLite, PostgreSQL & MariaDB; VirtualTreeView
Marc
Administrator
Hero Member
Posts: 2615
Re: When a public variable can not be assigned?
«
Reply #3 on:
July 23, 2010, 12:58:23 am »
Or do you mean a readonly property ?
Logged
//--
{$I stdsig.inc}
//-I still can't read someones mind
//-Bugs reported here will be forgotten. Use the
bug tracker
Print
Pages: [
1
]
« previous
next »
Lazarus
»
Forum
»
Programming
»
General
»
When a public variable can not be assigned?
TinyPortal
© 2005-2018