InideletePvt with @wholesection
Keywords: inidelete wholesection
Question:
I am trying to remove a section in a program and am using the INIReadPvt function to get @WHOLESECTION. It appears the EXE looks for a KEY @WHOLESECTION rather than interpreting it to delete the entire section.Is there an elegant way with quotes or percents or SOMETHING so I don't have to parse the line first and decide if I need to get the entire section?
Answer:
This works for me. Notice there are no quotes around @wholesection:IniDeletePvt("sectionName",@WHOLESECTION, "path\whatever.ini")@WHOLESECTION is a built in constant in WinBatch. But sometimes by the time you get to it (if you're doing variable substitution), it has transmogrified itself into a string of "@WHOLESECTION". This is the part that needs to be fixed.Try:
IniFileName = ItemExtract(1,IniEntry, ",") SectionName = ItemExtract(2,IniEntry, ",") KeyName=ItemExtract(3,IniEntry, ",") Message("Sectioname before",Sectionname) if Sectionname=="@WHOLESECTION" then Sectionname=@WHOLESECTION Message("Sectioname after",Sectionname)
Article ID: W13336Filename: IniDelete Wholesection.txt