Hi,
I am new to AMS. I need suggestion for manipulating a .ini file.
I need to find if a .ini file exists, if it exists, need to look for 3 names [field] in a particular section, if any one of the names[fileds] doesnt exists then i need to update the file with the missing name.
I am able to find the file and the section and also the names, but not sure how to check the name[fields] doesnt exist.
Below is my code. Please advice.
I am new to AMS. I need suggestion for manipulating a .ini file.
I need to find if a .ini file exists, if it exists, need to look for 3 names [field] in a particular section, if any one of the names[fileds] doesnt exists then i need to update the file with the missing name.
I am able to find the file and the section and also the names, but not sure how to check the name[fields] doesnt exist.
Below is my code. Please advice.
Code:
if File.DoesExist(OptimPath.."\\cntlpack\\print.INI") then all_sections = INIFile.GetSectionNames(OptimPath.."\\cntlpack\\print.INI"); for index_section, section in pairs(all_sections) do if section == "IRD PRINT PARAMETERS" then value_names = INIFile.GetValueNames(OptimPath.."\\cntlpack\\print.INI", section); for index_section, valuenames in pairs(value_names) do [COLOR="red"]--Need to do the logic. try to find the name, if not exisit, enter the name [/COLOR] end end end end
Comment