Talk:Update a configuration file: Difference between revisions
Content added Content deleted
m (added a response.) |
(→A generic solution for the problem: new section) |
||
Line 47: | Line 47: | ||
:::: I would like to wait and get my (above) voiced concerns/queries answered/addressed first. -- [[User:Gerard Schildberger|Gerard Schildberger]] ([[User talk:Gerard Schildberger|talk]]) 07:36, 12 May 2015 (UTC) |
:::: I would like to wait and get my (above) voiced concerns/queries answered/addressed first. -- [[User:Gerard Schildberger|Gerard Schildberger]] ([[User talk:Gerard Schildberger|talk]]) 07:36, 12 May 2015 (UTC) |
||
== A generic solution for the problem == |
|||
Well, as I saw in the previous comments, the task was really complex. And it could be, so I did a generic solution for the problem: |
|||
1) The solution in BASIC (QB45) reads ANY configuration file and shows what it found. |
|||
2) If there is an array (FAMILY John Smith, Lisa Smith, Charles Smith) the program will create an array of elements FAMILY. |
|||
3) If FAMILY variable is repeated in another part of the configuration file, will simply add the found elements to the existing array. |
|||
4) The main procedure can toggle the comment status of a variable in the configuration file as per User request. |
|||
5) The main procedure will save all the elements of an array in just one line. This way, if you have a situation like this: |
|||
FAMILY John Smith, Lisa Smith, Charles Smith |
|||
FRUITSILIKE banana |
|||
FAMILY Donna Smith |
|||
FAMILY Rachel Smith |
|||
Will end as follows: |
|||
FAMILY John Smith, Lisa Smith, Charles Smith, Donna Smith, Rachel Smith |
|||
FRUITSILIKE banana |
|||
6) The main procedure is able, when saving, to record the variables and values with a "=" or with a space (" ") in between. The configuration file reader can identify both of them. |
|||
7) The program can identify if a variable name is an array or not, and, if so, to return the number of elements in the array. |
|||
8) The above explained functionality lead to a very large program. Nevertheless, as per my understanding, it amply meets the requirements of the task. |