Board index » delphi » Are there static class members in ObjectPascal
Bogdan Ribic
![]() Delphi Developer |
Wed, 13 Oct 2004 04:00:21 GMT
|
Bogdan Ribic
![]() Delphi Developer |
Wed, 13 Oct 2004 04:00:21 GMT
Are there static class members in ObjectPascal
Hi,
What I mean is can you use the C++ system like class foo { Quote}; in Delphi's help but didn't get anything related to this. Thanx... |
Team
![]() Delphi Developer |
Wed, 13 Oct 2004 04:24:48 GMT
Re:Are there static class members in ObjectPascalIn article <3cc9b35c_2@dnews>, Bogdan Ribic says... Quote> Hi, them by putting a "global" variable in the implementation section of the unit in which the classes are declared, and, if necessary, having a property with getter and setter methods that access it. There are static member functions though, they are called class "If we knew what it was we were doing, it would not be called research, |
Bogdan Ribi
![]() Delphi Developer |
Wed, 13 Oct 2004 06:37:07 GMT
Re:Are there static class members in ObjectPascalThanx Now, can I somehow use a variable within a procedure that will preserve Rudy Velthuis (TeamB) <rvelth...@gmx.de> wrote in message Quote> In article <3cc9b35c_2@dnews>, Bogdan Ribic says... |
Team
![]() Delphi Developer |
Wed, 13 Oct 2004 07:06:39 GMT
Re:Are there static class members in ObjectPascalIn article <3cc9d7e2_1@dnews>, Bogdan Ribic says... Quote> Thanx the {$WRITEABLECONST} option. procedure TMyClass.DoSomething; "If we knew what it was we were doing, it would not be called research, |
Arjan
![]() Delphi Developer |
Wed, 13 Oct 2004 09:00:53 GMT
Re:Are there static class members in ObjectPascalHi Rudy; Why use typed constants?, didn't you say ( in your previous post) the implementaion level global variables act as static fields. Could you shed some light on this please. BTW : thanks for the pointing out {$WRITEABLECONST} compiler option, it will "Rudy Velthuis (TeamB)" <rvelth...@gmx.de> wrote in message Quote> In article <3cc9d7e2_1@dnews>, Bogdan Ribic says... |
Team
![]() Delphi Developer |
Wed, 13 Oct 2004 09:31:37 GMT
Re:Are there static class members in ObjectPascalIn article <3cc9f7c4_2@dnews>, Arjang says... Quote> Hi Rudy; between calls. They are of course in the same storage class as unit globals, but not in the same scope. Only the routine can modify them. Quote> BTW : thanks for the pointing out {$WRITEABLECONST} compiler option, it will -- Rudy Velthuis (TeamB) "If we knew what it was we were doing, it would not be called research, |
Arjan
![]() Delphi Developer |
Wed, 13 Oct 2004 09:51:55 GMT
Re:Are there static class members in ObjectPascalI have been surfing these news groups and any delphi related material for past 5 years at least and this is the first time I have heard of this, Do you have a list or repository of calssical sloutions somewhere, or is it just the pure intelligence that makes the connection between a compiler directive and what it could be used for. TIA Arjang Quote> They are the classical answer to local variables that must remain static |
Team
![]() Delphi Developer |
Wed, 13 Oct 2004 10:07:03 GMT
Re:Are there static class members in ObjectPascalIn article <3cca03ba_1@dnews>, Arjang says... Quote> just the pure intelligence that makes the connection between a compiler But this technique has been discussed before. It can be used to emulate "If we knew what it was we were doing, it would not be called research, |
Andy
![]() Delphi Developer |
Wed, 13 Oct 2004 19:18:03 GMT
Re:Are there static class members in ObjectPascalAnd if you even more lazy, check in the project options | compiler | assignable typed constants BTW if you use unit scope variable, you do not need that const, just use var "Rudy Velthuis (TeamB)" <rvelth...@gmx.de> wrote in message Quote> In article <3cc9f7c4_2@dnews>, Arjang says... |
David Farrell-Garci
![]() Delphi Developer |
Thu, 14 Oct 2004 07:55:37 GMT
Re:Are there static class members in ObjectPascalWhile I am sure Rudy is capable of doing just that, this has been a standard solution for emulating static variables for many moons with OP (oops, I mean the Delphi language) Quote"Arjang" <nos...@me.com> wrote in message news:3cca03ba_1@dnews... |
1. Static class members. singletons
2. Static data members in class - How?
4. static Variables and Class Member Functions Across Projects
6. accessing common class members in classes derived from different vcl controls
8. How to initialize a class data member