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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...