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 ...


Hi Nathalie,

if you create a TEntryForm-element, for example EntryForm1, you can
use the File_Name combobox  then in the unit main with
EntryForm1.File_Name.Text;

Bye, Michael

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


In MainForm do something like
fname:=EntryForm1.File_Name.Text;
this will go to EntryForm1 and get the Text from the File_Name component
there.

HTH

  Roel

Quote
Nathalie <lech...@NOSPAMM.ntic.qc.ca> wrote:
> 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