Board index » delphi » HELP! Tell me I am dreaming ...

HELP! Tell me I am dreaming ...

In a form called 'TMainForm' I am reading/writing to an ini file:

    IniFile.WriteString('ProjectData', 'File_Name', File_Name.Text);

    File_Name.Text := IniFile.ReadString('ProjectData', 'File_Name',
'Not found!');

Then I create a text file called ...

     fname:=File_Name.Text;
     AssignFile(OutFile,fname);

THE PROBLEM IS THAT I entered 'File_Name.Text' on another form called
'TEntryForm'.

How can I call up 'File_Name.Text' in 'TMainForm' on 'TEntryForm'?
Tell me I am dreaming and I can't do this!

---------------------------------------------------------
---------------------------------------------------------

In TEntryForm I do use TMainForm:

        implementation

        uses main;

In TMainForm I do use TEntryForm:

        uses Unit1;

 

Re:HELP! Tell me I am dreaming ...


You can access any form from another form..
if the field your trying to access is in the second form then you do this.

some code in your form1,...

form1.EDIT.TEXT :=  Form2.EdIT.TEXT

 or if you want acess to dat avariables in another unit then place the
var's in the INTERFACE section and include the unit name in your
uses list of your unit that you want to call from..

Nathalie <lech...@NOSPAMM.ntic.qc.ca> wrote in article
<35F96FD1.6...@NOSPAMM.ntic.qc.ca>...

Quote
> In a form called 'TMainForm' I am reading/writing to an ini file:

>     IniFile.WriteString('ProjectData', 'File_Name', File_Name.Text);

>     File_Name.Text := IniFile.ReadString('ProjectData', 'File_Name',
> 'Not found!');

> Then I create a text file called ...

>      fname:=File_Name.Text;
>      AssignFile(OutFile,fname);

> THE PROBLEM IS THAT I entered 'File_Name.Text' on another form called
> 'TEntryForm'.

> How can I call up 'File_Name.Text' in 'TMainForm' on 'TEntryForm'?
> Tell me I am dreaming and I can't do this!

> ---------------------------------------------------------
> ---------------------------------------------------------

> In TEntryForm I do use TMainForm:

>    implementation

>    uses main;

> In TMainForm I do use TEntryForm:

>    uses Unit1;

Other Threads