Re: TZF -

[email protected]
Newsgroups gmane.comp.lang.delphi.topaz,gmane.spam.detected
Message-ID <[email protected]>
Concerning calling a procedure from a button click .. the following will 
work.
There are two buttons (button1 and button2) which call procedures which
append data from a file (either a text file (CSV) or a database file(DBF))
Bob


unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, Grids, DBGrids, atzgrids, DB, tzprimds, ucommon, utzcds, utzfds,
  StdCtrls;

type
  TForm1 = class(TForm)
    DBF_Junk: TTzDbf;
    DataSource1: TDataSource;
    TzGrid1: TTzGrid;
    Button2: TButton;
    Button1: TButton;
    procedure AppCSV(Sender: TObject);
    procedure Button2Click(Sender: TObject);
    procedure AppDBF(Sender: TObject);
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.AppCSV(Sender: TObject);
begin
  dbf_junk.AppendFromSDF('junk.txt',nil);
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
  AppCSV(self);
end;

procedure TForm1.AppDBF(Sender: TObject);
begin
  dbf_junk.AppendFrom('junk_2');
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
  AppDBF(self);
end;

end.
_______________________________________________________________


> 2nd Question.
> ------------
> Create a procedure 
> Procedure DoThis;
> Begin 
> End;
> 
> And you can call it easily enough by just entering DoThis;
> 
> Procedure DoThat;
> Begin
> // call procedure
>   DoThis;
> End;
> 
> 
> OK Now my question. Button on forum and create an event like so
> // silly example but I hope you get the jist of what I mean.
> 
> procedure TForm1.DBFData1Click(Sender: TObject);
> begin
>   SalesForm.SalesDBF.AppendFrom('mydata.dbf');
> end;
> 
> Then write a procedure like so
> 
> procedure TForm1.ImportBtnClick(Sender: TObject);
> begin
>    case TzDialogBox('Import Utility','?','Select Data Type To Import',
>                     'DBF CSV Abort') Of
>      'd','D' : ; // TForm1.DBFData1Click;
>      'c','C' : ; // TForm1.CSVData1Click(Sender: TObject);
>      'a','A' : Exit;
>    end; // case
> end;
> 
> This don't work so I'm wondering how do we call a procedure created by a 
> button event.
> 
> Anybody help!  Please
> 
> Many thanks in advance
> 
> Jerry
> 

==^================================================================
This email was sent to: [email protected]

EASY UNSUBSCRIBE click here: http://topica.com/u/?clvXPN.a5kvff.Z2NsZHQt
Or send an email to: [email protected]

TOPICA - Start your own email discussion group. FREE!
http://www.topica.com/partner/tag02/create/index2.html
==^================================================================
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.