Link to home
Start Free TrialLog in
Avatar of Yaku Kakashi
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(sCheckBox1.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(Sender: TObject);
begin
sMemo1.Clear;
sMemo1.Lines.Add(sEdit1.Text);
sMemo1.Lines.Add(sEdit2.Text);
sMemo1.Lines.Add(sEdit3.Text);
sMemo1.Lines.Add(sCheckBox1.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
Avatar of Geert G
Geert G
Flag of Belgium image

checkbox.text doesn't exist ?

it's certainly not the constructor
what components are those ?
never seen an sRadioButton, sGroupBox, etc in the uses clause
Avatar of Yaku Kakashi
Yaku Kakashi

ASKER

Sorry that is CheckBox1.Checked
Just don't mind the other types I remove some of those Just the button1 only
SOLUTION
Avatar of Geert G
Geert G
Flag of Belgium image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Geert Gruwez I'll give it a try. Thank You.
it Works Geert Gruwez, thank you.
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;
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I already Solve it using this code..

procedure TForm1.sButton2Click(Sender: TObject);
var
  value :  String ;
begin
value := sMemo1.Lines[0];
sCheckBox1.Checked := StrToBool(value);
end;

end.
Thank You Geert Gruwez, You are a life saver thank you so much.
Question answered by: Geert Gruwez
Thanks Dude
no problem, dude