tW34k Posted October 26, 2007 Share Posted October 26, 2007 Just wondering if there is any way too use variables in the output filename.ini? Like: #include <Date.au3> $2 = _nowcalc() IniWrite ( @ScriptDir & "\files\Logg\$2.ini", "section", "key", "value" ) like that? (Obviously this doesn't work as I've tried it but you get the idea) So, instead of "logg.ini" it would be "current time (_nowcalc)".ini I am very new too autoit so please, help! Pat. Link to comment Share on other sites More sharing options...
Nahuel Posted October 26, 2007 Share Posted October 26, 2007 Should work like this: #include <Date.au3> $2 = _nowcalc() IniWrite ( @ScriptDir & "\files\Logg\"&$2&".ini", "section", "key", "value" ) Link to comment Share on other sites More sharing options...
tW34k Posted October 26, 2007 Author Share Posted October 26, 2007 It won't write any .ini with that script. Weird stuff. Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted October 26, 2007 Moderators Share Posted October 26, 2007 I'm pretty sure that the result of _NowCalc() usese illegal file name chars 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...
Nahuel Posted October 26, 2007 Share Posted October 26, 2007 Haha, my thoughts exactly. My bad, sorry. Link to comment Share on other sites More sharing options...
tW34k Posted October 26, 2007 Author Share Posted October 26, 2007 (edited) Haha, I didn't think of that. I'm going too see if I can work this out then. Hell yea! I just took the _nowcalc function from the date.au3 and edited it inside my script so I won't need too include date.au3 Thanks for help=) Edit: How can I add more keys in one iniwrite command? Is that possible? Like: [section] Key1=value1 Key2=value2 Key3=value3 Is that possible by only using the iniwrite command once? Edited October 27, 2007 by tW34k Link to comment Share on other sites More sharing options...
Nahuel Posted October 27, 2007 Share Posted October 27, 2007 I don't think so.. although you could use it just once inside a loop: For $i=1 To 10 IniWrite("MyIni.ini","Section","Key"&$i,"Value"&$i) Sleep(25);Just in case :P Next Link to comment Share on other sites More sharing options...
tW34k Posted October 27, 2007 Author Share Posted October 27, 2007 Ok, I don't get that haha. Thanks anyway though, I guess one key will be enough. Link to comment Share on other sites More sharing options...
Nahuel Posted October 27, 2007 Share Posted October 27, 2007 But didn't that do what you wanted? All it does is call IniWrite() 10 times and increase the value of $i every loop. This is what the ini looks like. [Section] Key1=Value1 Key2=Value2 Key3=Value3 Key4=Value4 Key5=Value5 Key6=Value6 Key7=Value7 Key8=Value8 Key9=Value9 Key10=Value10 Link to comment Share on other sites More sharing options...
tW34k Posted October 27, 2007 Author Share Posted October 27, 2007 I see. Allright, I will try it. Thanks alot! 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