0

Hi people ,

I have an easy question(but lack the knowledge in Delphi),

I have a piece of code that i want to run but don't want to type it over for every time
it has to be run (not very good coding then). Is there a way i can place it in a procedure
or function and just call it every time(like a method).

An Example would be clearing a bunch of TEdit boxes at different button events or Naming Labels based on Grid columns?


#Note I'm working with Delphi 6

2
Contributors
2
Replies
3
Views
6 Years
Discussion Span
Last Post by ReaperUser101
1

Just put it in a function/procedure and call it. Define it like this:

interface

TForm1 = class(TForm)
private
  procedure RepetitiveTask;
end;

implementation

procedure TForm1.RepetitiveTask;
begin
  // ...
end;
0

Thanks pritaeas!
I managed to do it on my own , but in the same why you explain it here.
All I did different is add components.

procedure ClearEdits (a,b: TEdit);
begin
 a.Clear;
 b.Clear;
end;
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.