Jump to content

Call procedure/function in Unit File on unigui project


Point

Recommended Posts

the following is an illustration :

1. Unit File :

Quote

unit MyUnit;

interface

uses
  Data.DB, Datasnap.DBClient;

  procedure CloseOpenDataset;


implementation

uses
  UnitDataModule1;


procedure CloseOpenDataset;
begin
   with Datamodule1.ClientDataSet1 do begin 
      Close; Open;
   end;
end;

end.

2. Unit Data Module :

Quote

unit UnitDataModule1;

interface

uses
  SysUtils, Classes;

type
  TDataModule1 = class(TDataModule)
    ClientDataSet1: TClientDataSet;
  private
    { Private declarations }
  public
    { Public declarations }
  end;
.
.
.

initialization
  RegisterModuleClass(TDataModule1);

end.

3.  Unit Form1 :

Quote

unit UnitForm1;

interface

.
.
.

uses
   MyUnit;    

procedure TUniForm1.UniButton1Click(Sender: TObject);
begin
  CloseOpenDataset;
end;

end.

 

when active session more then one and one of the user call the procedure CloseOpenDataset, will it be done simultaneously in each session ?

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...