Re: Is it posible?


[ Delphi Forum -- by DelphiLand ]

Posted by WAllison on December 25, 2003 at 16:11:44:

In Reply to: Is it posible? posted by Joey on November 21, 2003 at 22:30:12:

: is it possible to make my own procedure not using one that a component makes? In the app i've been making i want to set the enablility of certain button at certain times and this happens under bout 5 different button presses..... what i have been doing is making an invisible button and then putting the code in there and calling it using EnableButtonClick(Sender); i want to know if i can make one with out having a component controlling it and if so how can i call it from some where else? or will it use the (Sender) thingi?


//Read this

unit Unit1;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs;

type
TForm1 = class(TForm)
private
{ Private declarations }
public
{ Public declarations }
procedure MyProcedure; //public or private - if u use private - only this unit
//can call the procedure/function
end;

var
Form1: TForm1;

implementation

{$R *.dfm}

//u can declare procedures/functions without using the unit
//This must be declared before the procedure/function that is going to call it
procedure MyExtProcedure;
begin
end;

// this is declared in the public section
procedure TForm1.MyProcedure;
begin
MyExtProcedure;
end;


end.





[ Delphi Forum ]
[ DelphiLand: free Delphi source code, tips, tutorials ]