home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Delphi Programming Unleashed
/
Delphi_Programming_Unleashed_SAMS_Publishing_1995.iso
/
chap32
/
ddepdox2
/
main.pas
< prev
next >
Wrap
Pascal/Delphi Source File
|
1995-03-20
|
2KB
|
84 lines
unit Main;
{ Program copyright (c) 1995 by Charles Calvert }
{ Project Name: DDEPDOX2 }
{ Make sure a copy of PDOXDEL.EXE is on your
path before running this programming. Or
alternately, use PARADOX for Windows. }
interface
uses
SysUtils, WinTypes, WinProcs,
Messages, Classes, Graphics,
Controls, Forms, Dialogs,
StdCtrls, DdeMan;
const
FieldNames: array[1..7] of String =
('CustNo', 'Company', 'Addr1', 'Addr2',
'City', 'State', 'Zip');
type
TForm1 = class(TForm)
DdeClientConv1: TDdeClientConv;
DdeClientItem1: TDdeClientItem;
DdeClientItem2: TDdeClientItem;
Edit1: TEdit;
Edit2: TEdit;
Edit3: TEdit;
Edit4: TEdit;
DdeClientItem3: TDdeClientItem;
DdeClientItem4: TDdeClientItem;
DdeClientItem5: TDdeClientItem;
DdeClientItem6: TDdeClientItem;
DdeClientItem7: TDdeClientItem;
Edit5: TEdit;
Edit6: TEdit;
Edit7: TEdit;
OpenLink: TButton;
procedure DdeClientItem1Change(Sender: TObject);
procedure OpenLinkClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
procedure TForm1.DdeClientItem1Change(Sender: TObject);
begin
Edit1.Text := DDEClientItem1.Text;
Edit2.Text := DDEClientItem2.Text;
Edit3.Text := DDEClientItem3.Text;
Edit4.Text := DDEClientItem4.Text;
Edit5.Text := DDEClientItem5.Text;
Edit6.Text := DDEClientItem6.Text;
Edit7.Text := DDEClientItem7.Text;
end;
{ Strings could be 'PDOXWIN', ':DBDEMOS:CUSTOMER.DB', if
you have Paradox for Windows. If you don't, use
'PDOXDEL', 'DBDEMOSCUSTOMER' as th estrings passed
to SetLink. }
procedure TForm1.OpenLinkClick(Sender: TObject);
var
i: Integer;
begin
DDEClientConv1.SetLink('PDOXDEL', 'DBDEMOSCUSTOMER');
for i := 1 to 7 do begin
TDDEClientItem(FindComponent('DDEClientItem' + IntToStr(i))).DDEConv := DDEClientConv1;
TDDEClientItem(FindComponent('DDEClientItem' + IntToStr(i))).DDEItem := FieldNames[i];
end;
end;
end.