View previous topic :: View next topic |
Author |
Message |
patsmokeswii Grandmaster Cheater Supreme
Reputation: 0
Joined: 26 Aug 2007 Posts: 1039 Location: Perth Amboy, NJ
|
Posted: Sat Apr 26, 2008 3:09 pm Post subject: Help me out with this Delphi code problem. |
|
|
Code: | unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
MemoBox: TMemo;
Button1: TButton;
Button2: TButton;
Button3: TButton;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
procedure FormCreate(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
fileName : String;
fileData : TStringList;
openDialog : TOpendialog;
implementation
{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
begin
Form1.Caption:= 'Very simple spell corrector';
SaveButton.Enabled := false;
CorrectButton.Enabled := false;
MemoBox.Clear;
MemoBox.ScrollBars := ssBoth;
MemoBox.ReadOnly := true;
MemoBox.Font.Name := 'Calibri';
Label1.Caption := '';
Label2.Caption := '';
Label3.Caption := '';
Label4.Caption := '';
openDialog := TOpenDialog.create(self);
openDialog.Filter := 'Text files|*.txt';
fileData := TStringList.create;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
if openDialog.Execute then
begin
fileName:= openDialog.FileName;
CorrectButton.Enabled := true;
fileData.LoadFromFile(fileName);
MemoBox.Text := fileData.Text;
Label1.Caption := '';
Label2.Caption := '';
Label3.Caption := '';
Label4.Caption := fileName+' has '+IntToStr(fileData.Count)+
' lines of text';
end;
end. |
Alright, thats the code. It is not any longer because I get the error "cannot find implementation of method Button3Click" Mind telling me whats wrong with the code?
Also, this is something I'm doing to polish my Delphi, and learn overall, since I just got into the coding delphi stuff.
This code is from DephiBasicsco and some nr thing
Thx for your help in advance.
|
|
Back to top |
|
 |
oib111 I post too much
Reputation: 0
Joined: 02 Apr 2007 Posts: 2947 Location: you wanna know why?
|
Posted: Sat Apr 26, 2008 3:15 pm Post subject: |
|
|
You put to Button3Click procedures.
_________________
8D wrote: |
cigs dont make people high, which weed does, which causes them to do bad stuff. like killing |
|
|
Back to top |
|
 |
patsmokeswii Grandmaster Cheater Supreme
Reputation: 0
Joined: 26 Aug 2007 Posts: 1039 Location: Perth Amboy, NJ
|
Posted: Sat Apr 26, 2008 10:49 pm Post subject: |
|
|
oib111 wrote: | You put to Button3Click procedures. |
I noticed that, before your reply, and I changed it, but I still get the same thing. I can't click on button 2 or 3 for further coding.
|
|
Back to top |
|
 |
oib111 I post too much
Reputation: 0
Joined: 02 Apr 2007 Posts: 2947 Location: you wanna know why?
|
Posted: Sun Apr 27, 2008 12:30 am Post subject: |
|
|
As in you double click them and it doesn't open up the coding window or w/e? Just go in there manually and do it...
_________________
8D wrote: |
cigs dont make people high, which weed does, which causes them to do bad stuff. like killing |
|
|
Back to top |
|
 |
Symbol I'm a spammer
Reputation: 0
Joined: 18 Apr 2007 Posts: 5094 Location: Israel.
|
Posted: Sun Apr 27, 2008 1:21 am Post subject: |
|
|
You declared "Button3Click" procedure but never created one, delete " procedure Button3Click(Sender: TObject);" (both, not sure why there are 2..)
|
|
Back to top |
|
 |
patsmokeswii Grandmaster Cheater Supreme
Reputation: 0
Joined: 26 Aug 2007 Posts: 1039 Location: Perth Amboy, NJ
|
Posted: Sun Apr 27, 2008 10:28 am Post subject: |
|
|
Symbol wrote: | You declared "Button3Click" procedure but never created one, delete " procedure Button3Click(Sender: TObject);" (both, not sure why there are 2..) |
Ohh OK. well, how would I go on about doing that?
|
|
Back to top |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8587 Location: 127.0.0.1
|
|
Back to top |
|
 |
patsmokeswii Grandmaster Cheater Supreme
Reputation: 0
Joined: 26 Aug 2007 Posts: 1039 Location: Perth Amboy, NJ
|
Posted: Sun Apr 27, 2008 3:28 pm Post subject: |
|
|
I clearly stated that in my first post. Didn't have to point it out.
|
|
Back to top |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8587 Location: 127.0.0.1
|
Posted: Mon Apr 28, 2008 11:07 am Post subject: |
|
|
patsmokeswii wrote: |
I clearly stated that in my first post. Didn't have to point it out. |
Quote: | This code is from DephiBasicsco and some nr thing |
I was being more specific. Wasn't accusing you of stealing it. Just posting the link.
_________________
- Retired. |
|
Back to top |
|
 |
|