tW34k 0 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. Share this post Link to post Share on other sites
Nahuel 1 Posted October 26, 2007 Should work like this: #include <Date.au3> $2 = _nowcalc() IniWrite ( @ScriptDir & "\files\Logg\"&$2&".ini", "section", "key", "value" ) Share this post Link to post Share on other sites
tW34k 0 Posted October 26, 2007 It won't write any .ini with that script. Weird stuff. Share this post Link to post Share on other sites
SmOke_N 210 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. Share this post Link to post Share on other sites
Nahuel 1 Posted October 26, 2007 Haha, my thoughts exactly. My bad, sorry. Share this post Link to post Share on other sites
tW34k 0 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 Share this post Link to post Share on other sites
Nahuel 1 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 Share this post Link to post Share on other sites
tW34k 0 Posted October 27, 2007 Ok, I don't get that haha. Thanks anyway though, I guess one key will be enough. Share this post Link to post Share on other sites
Nahuel 1 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 Share this post Link to post Share on other sites
tW34k 0 Posted October 27, 2007 I see. Allright, I will try it. Thanks alot! Share this post Link to post Share on other sites