RobPouwelse
Technical User
I'm back.. 
and with a new error (for me)..
[Error] Unit1.pas(24): Unsatisfied forward or external declaration: 'TForm1.Func_from'
What am i doing wrong here??
I know it's something with Func_from (it's placement?)
but i already tried placing it in {public decleration} or removing it... didn't work
=================================
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
Menus, StdCtrls;
type
TForm1 = class(TForm)
MainMenu1: TMainMenu;
Bestand1: TMenuItem;
OpenTextbestand1: TMenuItem;
Opslaan1: TMenuItem;
Afsluiten1: TMenuItem;
Memo1: TMemo;
OpenDialog1: TOpenDialog;
procedure Afsluiten1Click(Sender: TObject);
procedure OpenTextbestand1Click(Sender: TObject);
function Func_from (Str1, Str2 :string):string ;
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
procedure TForm1.Afsluiten1Click(Sender: TObject);
begin
application.terminate();
end;
procedure TForm1.OpenTextbestand1Click(Sender: TObject);
var
F: TextFile;
Textline, Str_from : string;
begin
OpenDialog1.Options := [ofAllowMultiSelect, ofFileMustExist];
OpenDialog1.Filter := 'Text files (*.txt)|*.txt|All files (*.*)|*.*';
OpenDialog1.FilterIndex := 2;
if OpenDialog1.Execute then
with OpenDialog1.Files do
begin
AssignFile(F,OpenDialog1.Filename);
Reset(F);
while not Eof(F) do
begin
Readln(F, Textline);
Str_from := Func_from('from', Textline);
if Str_from='' then
else Memo1.Lines.Append(Str_from);
end;
CloseFile(F);
end;
end;
function Func_from (Str1, Str2 :string):string ;
var index, StrLength : integer;
begin
index := pos( Str1, Str2 ) + 5;
if index <> 0 then
begin
StrLength := pos( '>, size', Str2 ) - index;
Str1 := copy( Str2, index+1, strLength-1 );
end;
end;
end.
=========================
[Error] Unit1.pas(24): Unsatisfied forward or external declaration: 'TForm1.Func_from'
What am i doing wrong here??
I know it's something with Func_from (it's placement?)
but i already tried placing it in {public decleration} or removing it... didn't work
=================================
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
Menus, StdCtrls;
type
TForm1 = class(TForm)
MainMenu1: TMainMenu;
Bestand1: TMenuItem;
OpenTextbestand1: TMenuItem;
Opslaan1: TMenuItem;
Afsluiten1: TMenuItem;
Memo1: TMemo;
OpenDialog1: TOpenDialog;
procedure Afsluiten1Click(Sender: TObject);
procedure OpenTextbestand1Click(Sender: TObject);
function Func_from (Str1, Str2 :string):string ;
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
procedure TForm1.Afsluiten1Click(Sender: TObject);
begin
application.terminate();
end;
procedure TForm1.OpenTextbestand1Click(Sender: TObject);
var
F: TextFile;
Textline, Str_from : string;
begin
OpenDialog1.Options := [ofAllowMultiSelect, ofFileMustExist];
OpenDialog1.Filter := 'Text files (*.txt)|*.txt|All files (*.*)|*.*';
OpenDialog1.FilterIndex := 2;
if OpenDialog1.Execute then
with OpenDialog1.Files do
begin
AssignFile(F,OpenDialog1.Filename);
Reset(F);
while not Eof(F) do
begin
Readln(F, Textline);
Str_from := Func_from('from', Textline);
if Str_from='' then
else Memo1.Lines.Append(Str_from);
end;
CloseFile(F);
end;
end;
function Func_from (Str1, Str2 :string):string ;
var index, StrLength : integer;
begin
index := pos( Str1, Str2 ) + 5;
if index <> 0 then
begin
StrLength := pos( '>, size', Str2 ) - index;
Str1 := copy( Str2, index+1, strLength-1 );
end;
end;
end.
=========================