Newbie2 Posted January 12, 2005 Share Posted January 12, 2005 Let's assume I have this INI file: [MySection] Home=123456789 Office=987654321 Cell=123459876 I know I can extract each value of each key using INIREAD, but I wanna also to be able to exteact the KEY itself. Possible? Link to comment Share on other sites More sharing options...
trids Posted January 12, 2005 Share Posted January 12, 2005 Read each line: if the line has a "=", then StringSplit on "=" .. the array element with index = [1] will be the key name. Link to comment Share on other sites More sharing options...
Newbie2 Posted January 12, 2005 Author Share Posted January 12, 2005 10x, dude Link to comment Share on other sites More sharing options...
PerryRaptor Posted January 12, 2005 Share Posted January 12, 2005 Check the help file for IniRead() IniRead ( "filename", "section", "key", "default" ) A standard ini file looks like: [sectionName] Key=Value Related IniDelete, IniWrite, FileReadLine Example $var = IniRead("C:\Temp\myfile.ini", "section2", "key", "NotFound") MsgBox(4096, "Result", $var) Link to comment Share on other sites More sharing options...
Insolence Posted January 12, 2005 Share Posted January 12, 2005 I think perry is trying to say, you have to know the key first anyway "I thoroughly disapprove of duels. If a man should challenge me, I would take him kindly and forgivingly by the hand and lead him to a quiet place and kill him." - Mark TwainPatient: "It hurts when I do $var_"Doctor: "Don't do $var_" - Lar. Link to comment Share on other sites More sharing options...
MHz Posted January 12, 2005 Share Posted January 12, 2005 That's why Triads gave the answer? 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