PDA

View Full Version : saving in delphi


scratch
03-20-2005, 04:07 AM
i have a form with two groupbox's and inside the boxes are about 6 checkboxs each. i also have two buttons, one called btnSave, the other btnLoad.
how can i make it so when i click save, everything onscreen is saved to a file.
please help because i really need this. :o
thanks in advance.
-scratch :)

mehdi
01-13-2006, 07:19 PM
hi scratch,

I am Mehdi ,i did read your ask ,now i want help you ...
1.If you want your SAVE btn ,save chkboxs state in a file ,
easiest act :
add a MEMO object to your form and in memo1/properties/lines use 5 enter
to change memo1 lines to 6 lines for save and use same these commands :
procedure TForm1.Button1Click(Sender: TObject);
begin
memo1.lines.savetofile('your file');
end;
procedure TForm1.CheckBox1Click(Sender: TObject);
begin
if CheckBox1.Checked then
Memo1.Lines[0]:='1' //Or can use any thing you want
else
Memo1.Lines[0]:='0';
end;
Use these commands for all chkboxs you have but for chkbox2-3-4-5-6 use memo1.lines[1]..memo1.lines[5]
for LoadBtn just use memo1.lines.loadfromfile('your file'); with some IF commands or use case .. of command
to know chkboxs state.
Professional act :
You can use DataBases ,for exp :SQL server or easier use Delphi Databases for exp Paradox
if you want use databases ,tell me ,will send you how you can do that...
2.If you want save your project as .EXE file ,
you can use Delphi's menu/project/compile project1
or use Ctrl+F9 keys.

If you still have a problem contact me at :MehdiJavid@Mailftp.com