Topic: A little help

I have a little puzzled how to use this line of code, my experience is at the beginning, thanks in advance.

Form1.CheckBox1.Checked := StrToBool(Form1.CheckBox1,Form1.TableGrid1.dbItemID);

Form1.CheckBox1.dbItemID := SQLExecute ('SELECT IFNULL(id_ArdoA800X, -1)FROM ArdoA800X WHERE id = ' + IntToStr(Form1.TableGrid1.dbItemID) );

Re: A little help

Unfortunately I can't understand, what exactly you want to do. To many mistakes in the code.

Dmitry.

Re: A little help

Maybe some hints here: http://stackoverflow.com/questions/1972 … -of-sqlite

Re: A little help

I do understand there are two versions of what I wanted to do, I attach a project to be understood what I wanted. for much the promptness and courtesy, a great day!

Post's attachments

Attachment icon ArdoA800X.zip 1.34 mb, 498 downloads since 2016-07-26 

Re: A little help

einsteinf5 wrote:

I do understand there are two versions of what I wanted to do, I attach a project to be understood what I wanted. for much the promptness and courtesy, a great day!

Please explain, what you want to do?

Dmitry.

Re: A little help

equivalent function:
Form1.Edit2.Text := SQLExecute ('SELECT ArdoA800X.program FROM ArdoA800x WHERE id = ' + IntToStr(Form1.TableGrid1.dbItemID) );
but for function
Form1.CheckBox1.Checked ???

procedure Form1_TableGrid1_OnClick (Sender: string);

begin
Form1.Edit2.Text := SQLExecute ('SELECT ArdoA800X.program FROM ArdoA800x WHERE id = ' + IntToStr(Form1.TableGrid1.dbItemID) );
Form1.Edit3.Text := SQLExecute ('SELECT ArdoA800X.temperatura FROM ArdoA800x WHERE id = ' + IntToStr(Form1.TableGrid1.dbItemID) );
Form1.Edit4.Text := SQLExecute ('SELECT ArdoA800X.material FROM ArdoA800x WHERE id = ' + IntToStr(Form1.TableGrid1.dbItemID) );
Form1.Edit5.Text := SQLExecute ('SELECT ArdoA800X.GreutateRufe FROM ArdoA800x WHERE id = ' + IntToStr(Form1.TableGrid1.dbItemID) );
Form1.Edit6.Text := SQLExecute ('SELECT ArdoA800X.compartimente FROM ArdoA800x WHERE id = ' + IntToStr(Form1.TableGrid1.dbItemID) );
Form1.Edit7.Text := SQLExecute ('SELECT ArdoA800X.simbetich FROM ArdoA800x WHERE id = ' + IntToStr(Form1.TableGrid1.dbItemID) );
Form1.Memo1.Text := SQLExecute ('SELECT ArdoA800X.gradmurdarie FROM ArdoA800x WHERE id = ' + IntToStr(Form1.TableGrid1.dbItemID) );
Form1.Memo2.Text := SQLExecute ('SELECT ArdoA800X.descriereprog FROM ArdoA800x WHERE id = ' + IntToStr(Form1.TableGrid1.dbItemID) );
Form1.CheckBox1.Checked ??? here I do not know how to function completes "CheckBox"
Form1.CheckBox2.Checked ....????
Form1.CheckBox3.Checked ???
Form1.CheckBox4.Checked ???
Form1.CheckBox6.Checked ???

end;

Thanks for the patience and understanding!

Re: A little help

Check out this example:

if SQLExecute ('SELECT ArdoA800X.b1 FROM ArdoA800x WHERE id = ' + IntToStr(Form1.TableGrid1.dbItemID) ) = '1' then Form1.CheckBox6.Checked := True else Form1.CheckBox6.Checked := False;
Dmitry.

Re: A little help

Your example helped me a true blessing, attach whichever pleases me, once again THANK YOU!

procedure Form1_TableGrid1_OnClick (Sender: string);

begin
Form1.Edit2.Text := SQLExecute ('SELECT ArdoA800X.program FROM ArdoA800x WHERE id = ' + IntToStr(Form1.TableGrid1.dbItemID) );
Form1.Edit3.Text := SQLExecute ('SELECT ArdoA800X.temperatura FROM ArdoA800x WHERE id = ' + IntToStr(Form1.TableGrid1.dbItemID) );
Form1.Edit4.Text := SQLExecute ('SELECT ArdoA800X.material FROM ArdoA800x WHERE id = ' + IntToStr(Form1.TableGrid1.dbItemID) );
Form1.Edit5.Text := SQLExecute ('SELECT ArdoA800X.GreutateRufe FROM ArdoA800x WHERE id = ' + IntToStr(Form1.TableGrid1.dbItemID) );
Form1.Edit6.Text := SQLExecute ('SELECT ArdoA800X.compartimente FROM ArdoA800x WHERE id = ' + IntToStr(Form1.TableGrid1.dbItemID) );
Form1.Edit7.Text := SQLExecute ('SELECT ArdoA800X.simbetich FROM ArdoA800x WHERE id = ' + IntToStr(Form1.TableGrid1.dbItemID) );
Form1.Memo1.Text := SQLExecute ('SELECT ArdoA800X.gradmurdarie FROM ArdoA800x WHERE id = ' + IntToStr(Form1.TableGrid1.dbItemID) );
Form1.Memo2.Text := SQLExecute ('SELECT ArdoA800X.descriereprog FROM ArdoA800x WHERE id = ' + IntToStr(Form1.TableGrid1.dbItemID) );
if SQLExecute ('SELECT ArdoA800X.b1 FROM ArdoA800x WHERE id = ' + IntToStr(Form1.TableGrid1.dbItemID) ) = '1' then Form1.CheckBox1.Checked := True else Form1.CheckBox1.Checked := False;
if SQLExecute ('SELECT ArdoA800X.b2 FROM ArdoA800x WHERE id = ' + IntToStr(Form1.TableGrid1.dbItemID) ) = '1' then Form1.CheckBox2.Checked := True else Form1.CheckBox2.Checked := False;
if SQLExecute ('SELECT ArdoA800X.b3 FROM ArdoA800x WHERE id = ' + IntToStr(Form1.TableGrid1.dbItemID) ) = '1' then Form1.CheckBox3.Checked := True else Form1.CheckBox3.Checked := False;
if SQLExecute ('SELECT ArdoA800X.b4 FROM ArdoA800x WHERE id = ' + IntToStr(Form1.TableGrid1.dbItemID) ) = '1' then Form1.CheckBox4.Checked := True else Form1.CheckBox4.Checked := False;
if SQLExecute ('SELECT ArdoA800X.b5 FROM ArdoA800x WHERE id = ' + IntToStr(Form1.TableGrid1.dbItemID) ) = '1' then Form1.CheckBox5.Checked := True else Form1.CheckBox5.Checked := False;
end;

I learned something new today! smile Of course with your help smile