Solved

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

Posted on 2011-09-11
4
338 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

830 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