forger Posted June 2, 2006 Share Posted June 2, 2006 hey, I don't know if it's supposed to work this way, but if I use IniWrite(blah.ini,bluh,"","") IniDelete(blah.ini,bluh,"") The iniwrite creates the file, the section, a blank key containing a blank value. And inidelete doesn't clear the bluh section, but tries to clear an empty one (if I understood the meaning of the blank key). I have to use IniDelete(blah.ini,blah) Is anyone using a blank key? Hence can you fix the IniWrite and IniDelete somehow to check if a key entry is blank and not create the key nor try to delete it? I guess I could use some extra script lines on my behalf, but I don't see the point of creating/trying to delete a blank key Yet I use variables, something like this: IniDelete($inifile2del, $inisection2del, $inikey2del) and it would save me a bunch of lines where i check if $inikey2del = "" and overcome it. Cheers! Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted June 2, 2006 Moderators Share Posted June 2, 2006 (edited) Wow, I read this twice and still don't understand what your saying. Can you give an example of an ini section you don't want to delete (what it would look like) and one that you do want to delete? Edited June 2, 2006 by SmOke_N Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
Bert Posted June 2, 2006 Share Posted June 2, 2006 I read it 10 times, and I still don't get it....I think iniread will do what you want but, then again, I be real confused by your post... The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
forger Posted June 2, 2006 Author Share Posted June 2, 2006 I knew this was going to happen lol, um.. OK I'm not at home unfortunately, and my scripts are on the other hard disk :\ With Dim $name = "name", $nvalue = "mary", $surname = "surname", $svalue = "johnson", $emptykey = "", $emptyvariable = "" IniWrite("blah.ini","bluh",$name,$nvalue) IniWrite("blah.ini","bluh",$surname,$svalue) IniWrite("blah.ini","bluh",$emptykey,$emptyvariable) a blah.ini is created: [bluh]name=mary surname=johnson =That's what I mean by blank key, it just adds an equal sign there. Now if I use IniDelete("blah.ini","bluh",$emptykey) this is left: [bluh]name=mary surname=johnsonmeaning it only deletes the empty key when I pass the $emptykey field in IniDelete. For IniWrite: I expected it not to create the line with the equal sign. What's the point of creating it if the key is empty? For IniDelete: I wanted it to delete the whole section even when I pass the empty variable. Link to comment Share on other sites More sharing options...
Bert Posted June 2, 2006 Share Posted June 2, 2006 ok, why do need to make a key that looks like "=" anyway? The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
forger Posted June 2, 2006 Author Share Posted June 2, 2006 I pass in variables. if the key & value variables are empty, then sometimes it could come out like "=". My exact question is shouldn't IniWrite function detect that somehow? Link to comment Share on other sites More sharing options...
Valik Posted June 2, 2006 Share Posted June 2, 2006 I pass in variables. if the key & value variables are empty, then sometimes it could come out like "=". My exact question is shouldn't IniWrite function detect that somehow? Shouldn't you detect it? You are the one who doesn't want it there so validate your input. If you want to make the invariant that the key is empty, enforce it. As far as I'm concerned, since all the INI functions handle it correctly, there's no problem here. Link to comment Share on other sites More sharing options...
forger Posted June 2, 2006 Author Share Posted June 2, 2006 Ok thanks 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