ManualIniRead(StartString, StopString, iniFile) { Global Continue = True Record = False ArrayIndex = 0 Loop, Read, %iniFile% { If Continue = True { If Record = True Loop, parse, A_LoopReadLine, =, { If a_index = 1 { MirIndex++ ManKey%MirIndex% := A_LoopField } Else If a_index = 2 { ManVal%MirIndex% := A_LoopField } If a_loopfield = %StartString% { Record = True } Else If a_loopfield = %StopString% { Record = False Continue = False } } Else Loop, parse, A_LoopReadLine, =, { IfInString, A_LoopField, %StartString% { Record = True } Else { IfInString, A_LoopField, %StopString% { Record = False Continue = False } } } } Else { Break } } MirIndex := MirIndex - 1 Return }And here's how to retrieve it all. In this example I was using a dictionary file to replace words that the text to speech had trouble pronouncing with phonetic versions.
ManualIniRead("[Pronounce]","##EndOfWords##","dictionary.dic") Loop %IniReadIndex% { Word :=ManKey%A_Index% Replacement :=ManVal%A_Index% StringReplace, Text, Text, %word%, %replacement% ,All Sleep, 20 }
I'd like some feedback if it's not too much trouble. I'm relatively new at this so if there are better ways to do what I've done here I'd like to know. :lol: