Yaku Kakashi
asked on
Need Help Delphi 2010 CheckBox1 Stored value in memo
Hello Guys I'm new with Delphi which uses pascal language.
I'm trying to create simple application which loaded all values in sMemo.Text. All Strings were working fine except with Boolean values "CheckBox and radio Buttons"
here is the line I'm using
sMemo1.Lines.Add(sCheckBox 1.Create );
it gives me an error
[DCC Error] Unit1.pas(44): E2035 Not enough actual parameters.
here is my whole code
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, sCheckBox, sRadioButton, sGroupBox, sButton, sEdit, sMemo,
sLabel;
type
TForm1 = class(TForm)
sMemo1: TsMemo;
sEdit1: TsEdit;
sEdit2: TsEdit;
sEdit3: TsEdit;
sButton1: TsButton;
sButton2: TsButton;
sGroupBox1: TsGroupBox;
sRadioButton1: TsRadioButton;
sRadioButton2: TsRadioButton;
sCheckBox1: TsCheckBox;
sMemo2: TsMemo;
sLabel1: TsLabel;
procedure sButton1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.sButton1Click(Sende r: TObject);
begin
sMemo1.Clear;
sMemo1.Lines.Add(sEdit1.Te xt);
sMemo1.Lines.Add(sEdit2.Te xt);
sMemo1.Lines.Add(sEdit3.Te xt);
sMemo1.Lines.Add(sCheckBox 1.Create);
end;
end.
Anyone here knows that. My main purpose with this app is to load all configuration into memo instead of an ini file wich is easy to read an modified with someone. I want to load all config i memo and encrypt content in memo and save it as a file format
I'm trying to create simple application which loaded all values in sMemo.Text. All Strings were working fine except with Boolean values "CheckBox and radio Buttons"
here is the line I'm using
sMemo1.Lines.Add(sCheckBox
it gives me an error
[DCC Error] Unit1.pas(44): E2035 Not enough actual parameters.
here is my whole code
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, sCheckBox, sRadioButton, sGroupBox, sButton, sEdit, sMemo,
sLabel;
type
TForm1 = class(TForm)
sMemo1: TsMemo;
sEdit1: TsEdit;
sEdit2: TsEdit;
sEdit3: TsEdit;
sButton1: TsButton;
sButton2: TsButton;
sGroupBox1: TsGroupBox;
sRadioButton1: TsRadioButton;
sRadioButton2: TsRadioButton;
sCheckBox1: TsCheckBox;
sMemo2: TsMemo;
sLabel1: TsLabel;
procedure sButton1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.sButton1Click(Sende
begin
sMemo1.Clear;
sMemo1.Lines.Add(sEdit1.Te
sMemo1.Lines.Add(sEdit2.Te
sMemo1.Lines.Add(sEdit3.Te
sMemo1.Lines.Add(sCheckBox
end;
end.
Anyone here knows that. My main purpose with this app is to load all configuration into memo instead of an ini file wich is easy to read an modified with someone. I want to load all config i memo and encrypt content in memo and save it as a file format
what components are those ?
never seen an sRadioButton, sGroupBox, etc in the uses clause
never seen an sRadioButton, sGroupBox, etc in the uses clause
ASKER
Sorry that is CheckBox1.Checked
ASKER
Just don't mind the other types I remove some of those Just the button1 only
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Geert Gruwez I'll give it a try. Thank You.
ASKER
it Works Geert Gruwez, thank you.
ASKER
Hello sorry to ask you again. how can I retrieve in back using button2
here is My code
function StrToBool(b: Boolean): string;
begin
Result := '0';
if b then Result := '1';
end;
var List: TStrings;
begin
sEdit1.Text := sMemo1.Lines[0];
sEdit1.Text := sMemo1.Lines[1];
sEdit1.Text := sMemo1.Lines[2];
sCheckBox1.Checked := sMemo1.Lines[3];
end;
here is My code
function StrToBool(b: Boolean): string;
begin
Result := '0';
if b then Result := '1';
end;
var List: TStrings;
begin
sEdit1.Text := sMemo1.Lines[0];
sEdit1.Text := sMemo1.Lines[1];
sEdit1.Text := sMemo1.Lines[2];
sCheckBox1.Checked := sMemo1.Lines[3];
end;
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I already Solve it using this code..
procedure TForm1.sButton2Click(Sende r: TObject);
var
value : String ;
begin
value := sMemo1.Lines[0];
sCheckBox1.Checked := StrToBool(value);
end;
end.
procedure TForm1.sButton2Click(Sende
var
value : String ;
begin
value := sMemo1.Lines[0];
sCheckBox1.Checked := StrToBool(value);
end;
end.
ASKER
Thank You Geert Gruwez, You are a life saver thank you so much.
ASKER
Question answered by: Geert Gruwez
Thanks Dude
Thanks Dude
no problem, dude
it's certainly not the constructor