Solved

Is it safe to rearrange the procedure declaration in the interface section

Posted on 2011-09-11
4
334 Views
Last Modified: 2012-05-12
Hello,

I have all these procedures and functions declarations inside the interface section and some of it my own procedures and methods and some of it is generated by the component events found in the object inspector.

Is it safe to rearrange them as mine kinda has no order to it. Its hard to find things and Hard to see what functions or procedure I have implemented and what I have not.

Thanks,

Ben
0
Comment
Question by:AivsCoder
4 Comments
 
LVL 25

Accepted Solution

by:
epasquier earned 34 total points
ID: 36521141
it is totally safe, as long as you leave the generated ones (events) in the first section of objects

Of course, it is well to organize things a bit when a form is growing. I often even rearrange the components declarations, and of course events (so the generated parts)

Adding some section separators can help also, like
//==== SECTION 1 ===============================================
//---- SUB SECTION 1.1 -----------------------------------------

Open in new window

0
 
LVL 37

Assisted Solution

by:Geert Gruwez
Geert Gruwez earned 33 total points
ID: 36522719
the only thing you need to consider is top down logic
for procedures in the interface section this is no problem, but it may be in the implementation section

sample in implementation (doesn't compile)

 
procedure TestA;
begin
  TestB;
end;

procedure TestB;
begin
  ShowMessage('TestB');
end;

Open in new window


for class types (and const) this may be a problem in the interface
this compiles:
 
Const
  CParentID = 1;
 
Const 
  CChildID = CParentID + 1;

type
  TParentClass = class(TObject)
  end;

  TChildClass = class(TParentClass)
  end;

Open in new window


this doesn't compile:
 
Const 
  CChildID = CParentID + 1;

Const
  CParentID = 1;
 

type
  TChildClass = class(TParentClass)
  end;

  TParentClass = class(TObject)
  end;

Open in new window

0
 
LVL 32

Assisted Solution

by:ewangoya
ewangoya earned 33 total points
ID: 36526907

All procedures and functions in alphabetical order works well for me, actually if you use ctr+alt+shift, you will always get your procedures and functions arranged in order in the implementation
0
 

Author Closing Comment

by:AivsCoder
ID: 36527205
Thanks
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Convert Jpg /PNG To GIF 5 103
Delphi XE10, MySQL Query 4 109
Delphi : could not find program, '...exe' 2 118
Dev Express grid collapse 2 35
A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

744 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now