Recent

Author Topic: Get all components in a form and save values  (Read 1476 times)

Raul_ES

  • Full Member
  • ***
  • Posts: 183
  • My interests: Healthcare & Computers
    • My Linkedin Profile, you can add me to stay in contact.
Get all components in a form and save values
« on: January 28, 2020, 08:10:27 pm »
Hello,

I am working in a project where I have a form to manipulate configuration options of the application. This form has several tabsheets, checkboxes, etc.


I dont know how to:

* make a recursive iteration through  all the components contained

* check their values, true, false, a number, a string with a url, etc

* how to store them. I mean, obviously you can store them into a file but what is the best option/format for storing config and parameters when we talk of a multiplatform application? what you recommend? plain text, binary, use records, a dbf file? there are so many ways... is there any example?


regards
Pharmacy + Chemistry + Biology + Healthcare + Computing

If you have any interest or project related with these areas feel free to contact me!

Raul_ES

  • Full Member
  • ***
  • Posts: 183
  • My interests: Healthcare & Computers
    • My Linkedin Profile, you can add me to stay in contact.
Re: Get all components in a form and save values
« Reply #1 on: January 28, 2020, 08:15:31 pm »
The form is something like this:
Pharmacy + Chemistry + Biology + Healthcare + Computing

If you have any interest or project related with these areas feel free to contact me!

Raul_ES

  • Full Member
  • ***
  • Posts: 183
  • My interests: Healthcare & Computers
    • My Linkedin Profile, you can add me to stay in contact.
Re: Get all components in a form and save values
« Reply #2 on: January 28, 2020, 08:20:49 pm »
I found this example for iterating all components

Code: Pascal  [Select][+][-]
  1. procedure TForm.GetComponentList(Memo1: TMemo)
  2. var
  3.   i: Integer;
  4. begin
  5.  for i := 0 to ComponentCount-1 do
  6. if (NOT (Components[i] is TControl)) and (NOT Components[i].HasParent) then
  7.   Memo1.Lines.Add(Components[i].Name);
  8. end;


I am not sure about how to read the value if it's an iteration through "unknown" components. It will depend  on the nature of the component isn't it?
Pharmacy + Chemistry + Biology + Healthcare + Computing

If you have any interest or project related with these areas feel free to contact me!

CLA

  • Newbie
  • Posts: 6
Re: Get all components in a form and save values
« Reply #3 on: January 28, 2020, 08:37:30 pm »

Raul_ES

  • Full Member
  • ***
  • Posts: 183
  • My interests: Healthcare & Computers
    • My Linkedin Profile, you can add me to stay in contact.
Re: Get all components in a form and save values
« Reply #4 on: January 28, 2020, 10:05:23 pm »
thank you very much, I'll check it right now

regards
Pharmacy + Chemistry + Biology + Healthcare + Computing

If you have any interest or project related with these areas feel free to contact me!

 

TinyPortal © 2005-2018