Jump to content

Using variables in iniwrite name possible?


tW34k
 Share

Recommended Posts

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

  • Moderators

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

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 by tW34k
Link to comment
Share on other sites

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...