First of all, thank you tkbyd for the guide you posted, you obviously put a huge amount of work into it.
Having never used Delphi before i have had a chance to mess around with it this weekend and have a look into creating the application in your guide. Although i have gone through your guide i am having some issues compiling the program after the.
procedure TDD80f1.WriteString(sToSend:string);
begin
//shell
end;
procedure TDD80f1.SendChars(sToSend:string);
begin
//shell
end;
function TDD80f1.SetUpSerPort:byte;
begin
//shell
end;
function TDD80f1.OpenForRead:byte;
begin
//shell
end;
function TDD80f1.OpenForWrite:byte;
begin
//shell
end;
Im not sure if im putting it in the right place but i have attached a screenshot for you to have a look at.
http://img651.imageshack.us/img651/4954/37366035.jpg
I know its something obviously stupid which im doing, but when you say "down at the bottom insert the following" i assume you are referring to inserting the code after the last procedure?
This is my full code so far. If you notice any bits from further into the tutorial its because i continued despite the errors on this section of code. But everything was compiling untill this step.
unit DD80u1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
const ver='2 Apr 10';
RxBufferSize = 256;
TxBufferSize = 256;
//These constants are concerned with setting space
//aside for buffering data to and from the serial
//port. Make them too large, and space is wasted;
//too small, and the buffers won't be adequate to
//tide you over times when the computer's attention
//is elsewhere. It may be that there are places in
//the program where absolute values, or numbers from
//other sources were used which should be replaced
//with these constants.
type
TLaVersion = class(TForm)
buSendHello: TButton;
buSendBye: TButton;
buSeeIfTheresData: TButton;
buQuit: TButton;
Label1: TLabel;
procedure FormCreate(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure buQuitClick(Sender: TObject);
procedure buSendHelloClick(Sender: TObject);
procedure buSendByeClick(Sender: TObject);
private
{ Private declarations }
sPortState:set of (c,w,r);//For closed, open for write, open for read
hCommFile: THandle;
bTmp:byte;
procedure WriteString(sToSend:string);
procedure SendChars(sToSend:string);
function SetUpSerPort:byte;
function OpenForRead:byte;
function OpenForWrite:byte;
public
{ Public declarations }
end;
var
LaVersion: TLaVersion;
DCB: TDCB;
Config : string;
CommTimeouts : TCommTimeouts;
bErrCode:byte;
implementation
{$R *.dfm}
{$R+}
procedure TLaVersion.buSendByeClick(Sender: TObject);
begin
SendChars('Bye');
end;
procedure TLaVersion.buSendHelloClick(Sender: TObject);
begin
SendChars('Hello');
end;
procedure TLaVersion.FormClose(Sender: TObject; var Action: TCloseAction);
begin
if sPortState<>[c] then closehandle(hCommFile);
//showmessage('x');//For testing that closehandle is done regardless
// of whether app closed with buQuit or red X. It is, as long as
// the buQuitClick handler is "close", not "application.terminate"
end;
procedure TLaVersion.FormCreate(Sender: TObject);
begin
sPortState:=[c];//Changed to [r] if handle set up
//to read from the port, or [w] if
//handle set up to write to the port
laVersion.caption:='DD80, version: '+ver;
top:=100;
left:=100;
end;
procedure TDD80f1.WriteString(sToSend:string);
begin
//shell
end;
procedure TDD80f1.SendChars(sToSend:string);
begin
//shell
end;
function TDD80f1.SetUpSerPort:byte;
begin
//shell
end;
function TDD80f1.OpenForRead:byte;
begin
//shell
end;
function TDD80f1.OpenForWrite:byte;
begin
//shell
end;
end.