SRL Archive - Help and Support

me again, this time with forms...


Pure1993

2008-02-19 10:52:53

EDIT: Okay, Problem Solved, feel free to close this thread, it is unbelieveable what you can learn from looking through some auto-talkers. XD


Hi guyss,
sorry to bother you again, but I looked through some tuts, and have not found the answer to my question, so I guess I'll post it here…
So anyway, what I want to know is: When Creating a form, and I have a LabelEdit in there, what do I do in order to return the text which the user wrote into the DeBugBox? This might be a very simple/noobish questions, but yet I can't figure it out…
Thanks a lot in advance,
Stur Pure

n3ss3s

2008-02-19 11:28:53

Debug box…?

You mean what user wrote to the TEdit's field?

TEditName.Text

Pure1993

2008-02-19 11:52:47

Well, what the user wrote into the edit field, and that information is suppossed to be returned/typed in the Debugbox.
Here is just very simple form, cwould anyone mind adding the line or two which are needed?

program New;
var
frmDesign : TForm;
Label1 : TLabel;
Edit1 : TEdit;
Button1 : TButton;

procedure buttonclick(sender: TObject);
begin
Writeln('Button pressed!');
frmDesign.Caption:= frmDesign.Caption + '.';
frmDesign.ModalResult:= mrOk;
end;

Procedure SayForm;
Begin
frmDesign := CreateForm;
frmDesign.Left := 250;
frmDesign.Top := 114;
frmDesign.Width := 696;
frmDesign.Height := 480;
frmDesign.Caption := 'frmDesign';
frmDesign.Color := clBtnFace;
frmDesign.Font.Color := clWindowText;
frmDesign.Font.Height := -11;
frmDesign.Font.Name := 'MS Sans Serif';
frmDesign.Font.Style := [];
frmDesign.Visible := False;
frmDesign.PixelsPerInch := 96;
Label1 := TLabel.Create(frmDesign);
Label1.Parent := frmDesign;
Label1.Left := 272;
Label1.Top := 128;
Label1.Width := 21;
Label1.Height := 13;
Label1.Caption := 'Say:';
Edit1 := TEdit.Create(frmDesign);
Edit1.Parent := frmDesign;
Edit1.Left := 272;
Edit1.Top := 144;
Edit1.Width := 113;
Edit1.Height := 21;
Edit1.TabOrder := 8;
Edit1.Text := 'Edit1';
Button1 := TButton.Create(frmDesign);
Button1.Parent := frmDesign;
Button1.OnClick:= @buttonclick;
Button1.Left := 304;
Button1.Top := 184;
Button1.Width := 41;
Button1.Height := 25;
Button1.Caption := 'okay';
Button1.TabOrder := 9;
End;

procedure SafeSayForm;
var
v: TVariantArray;
begin
setarraylength(V, 0);
ThreadSafeCall('SayForm', v);
end;

procedure ShowFormModal;
begin
frmDesign.ShowModal;
end;

procedure SafeShowFormModal;
var
v: TVariantArray;
begin
setarraylength(V, 0);
ThreadSafeCall('ShowFormModal', v);
end;

begin
SafeSayForm;
SafeShowFormModal;
end.
Oh, btw, I know I used a normal Edit here, but it doesn't really change a lot, does it?

n3ss3s

2008-02-19 16:19:32

Writeln(Edit1.Text);