Hello.
I have a school project to do with Lazarus, but I have a problem.
I have a Survey, so I want to store the information somehow, so I thought about creating a text file and storing it there, it wasn't that hard, until I wanted to write the information that user entered in the text file... (how do I do that?)
program project1;
{$mode objfpc}{$H+}
uses
Sysutils,
{$IFDEF UNIX}{$IFDEF UseCThreads}
cthreads,
{$ENDIF}{$ENDIF}
Interfaces, // this includes the LCL widgetset
Forms, Unit1
{ you can add units after this };
{$R *.res}
var
f:textfile;
begin
RequireDerivedFormResource := True;
Application.Initialize;
Application.CreateForm(TfrmSurvey, frmSurvey);
Application.Run;
assignfile(f, 'Submited.txt');
rewrite(f);
close(f);
//
writeln(f, 'Hello') + edtName;
end.
I want to enter information that user entered via tEdit. It doesn't seem to work, what's wrong? I tried to use + edtName.Text; but it didn't work either.
Thank you!
P.S. Is it possible that the text file would be written when certain assigned button is clicked, and not when the application is closed?