oemript Posted May 7, 2018 Share Posted May 7, 2018 I would like to know on how to retrieve variable from another ini file. -------------------------------------- C:\A.ini labelA = A123 -------------------------------------- C:\B.ini labelA = retrieve variable labelA from C:\A.ini, which should return A123 -------------------------------------- Does anyone have any suggestions? Thanks in advance for any suggestions Link to comment Share on other sites More sharing options...
Developers Jos Posted May 7, 2018 Developers Share Posted May 7, 2018 Retrieve with what assuming this is not supposed to be an AutoIt3 question seeing the forum it is posted in? Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
HardXOR Posted July 9, 2018 Share Posted July 9, 2018 MsgBox(0, "read from A.ini", read_INI("C:\A.ini", "settings", "labelA")) MsgBox(0, "read from B.ini", read_INI("C:\B.ini", "settings", "labelA")) Func read_INI($filepath, $section, $key) $ini_value = IniRead($filepath, $section, $key, "0") If StringLeft($ini_value, 2) = "C:" Then $ini_value = IniRead($ini_value, $section, $key, "0") EndIf Return $ini_value EndFunc you can do this Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now