Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2011-09-11
4
Medium Priority
?
346 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 136 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 38

Assisted Solution

by:Geert Gruwez
Geert Gruwez earned 132 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:Ephraim Wangoya
Ephraim Wangoya earned 132 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

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

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
Suggested Courses

926 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