Published: what changed
Revision 0 to 1. Removed lines have a minus sign; added lines have a plus sign.
Title: Published
| Old | New | Line | |
|---|---|---|---|
| 1 | + | Back to [[Reserved words]]. | |
| 2 | + | ||
| 3 | + | The **published** modifier: | |
| 4 | + | ||
| 5 | + | - is part of object-oriented programming; | |
| 6 | + | - designates an area within a class that can be accessed from anywhere; | |
| 7 | + | - allows this section to get streaming properties just like when using the local directive **{M+}**. | |
| 8 | + | ||
| 9 | + | Example: | |
| 10 | + | ||
| 11 | + | ``` pascal | |
| 12 | + | Type | |
| 13 | + | TEltern class = class // The parent class is derived from the base class | |
| 14 | + | published | |
| 15 | + | constructor Create(intWidth, intHeight : Integer); // The constructor is public and has streaming properties | |
| 16 | + | function surface double; // The function is public and has streaming properties | |
| 17 | + | end; | |
| 18 | + | ``` | |
| 19 | + | ||
| 20 | + | --- | |
| 21 | + | *From the Free Pascal wiki, page "Published", as it stood on 2020-02-23 after a change by Trev, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).* |
