Talk:Update a configuration file: Difference between revisions

m (added a response.)
 
(One intermediate revision by the same user not shown)
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)
 
== 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:
 
# The solution in BASIC (QB45) reads ANY configuration file and shows what it found.
# If there is an array (FAMILY John Smith, Lisa Smith, Charles Smith) the program will create an array of elements FAMILY.
# If FAMILY variable is repeated in another part of the configuration file, will simply add the found elements to the existing array.
# The main procedure can toggle the comment status of a variable in the configuration file as per User request.
# 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
#:
# 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.
# 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.
# The above explained functionality lead to a very large program. Nevertheless, as per my understanding, it amply meets the requirements of the task.
Anonymous user