Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Can Public be declared more than once.

Posted on 2009-07-03
3
Medium Priority
?
151 Views
Last Modified: 2012-05-07
Dear Experts,

I have some code on EE that i have put in the code-secion.
you see that the word Public has been declared twice.
Can this be done?, or is it an error and it has to be Published!

Peter Kiers

type
  TItem = class(TObject)
  private
    fStatus: byte;
    fParentID: integer;
    fNodeText: string;
    fID: integer;
    fData: string;
    fSaver: TAdoQuery;
    fChanged: Boolean;
    fSaveImmediate: boolean;
    fIsNew: Boolean;
    fImageIndex: integer;
    procedure SetData(const Value: string);
    procedure SetNodeText(const Value: string);
    procedure SetParentID(const Value: integer);
    procedure SetStatus(const Value: byte);
    procedure SetImageIndex(const Value: integer);
  protected
    procedure Changed; dynamic;
  public
    constructor Create(aSaver: TAdoQuery; AId, AParentID: integer; AStatus: byte);
    constructor LoadFromDataset(aSaver: TAdoQuery);
    procedure Save;
    procedure Delete;
    procedure BeginUpdate;
    procedure EndUpdate;
  public
    property ID: integer read fID write fID;
    property ParentID: integer read fParentID write SetParentID;
    property ImageIndex: integer read fImageIndex write SetImageIndex;
    property Status: byte read FStatus write SetStatus;
    property Data: string read fData write SetData;
    property NodeText: string read fNodeText write SetNodeText;
  end;

Open in new window

0
Comment
Question by:peterkiers
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 11

Accepted Solution

by:
dougaug earned 2000 total points
ID: 24772337
I've compiled the class above and didn't get any errors. I didn't understand why public has been declared twice?

There is no problem to declare methods and properties under the same public section.

Regards
0
 
LVL 1

Author Comment

by:peterkiers
ID: 24772357
OK.
0
 
LVL 38

Expert Comment

by:Geert Gruwez
ID: 24823199
i changed published to public

you can declare private, protected, public, published as many times as you like

this is usually done when in test or draft stage
afterwards the sections are combined when doing code cleanup
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

618 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question