Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2011-09-11
4
Medium Priority
?
343 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
[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
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

New benefit for Premium Members - Upgrade now!

Ready to get started with anonymous questions today? It's easy! Learn more.

Question has a verified solution.

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

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
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…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Suggested Courses

719 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