Jump to content

IniWrite Problem(Solved)


Recommended Posts

[OLD]

Why wont this work? my head hurts.

IniWrite("C:\Temp\myfile.ini", "section2", "key", @username @MON @MDAY @MIN)

[NEW]

IniWrite("C:\log.ini", "Greating", "Hi","@Username&"Welcome in to the room")

How do i make it so that each time this ini file is written to it appears on the next line without overwriting?

Edited by lordicast
[Cheeky]Comment[/Cheeky]
Link to comment
Share on other sites

  • Developers

Why wont this work? my head hurts.

Is that the reason for posting in the wrong forum ?

IniWrite("C:\Temp\myfile.ini", "section2", "key", @username @MON @MDAY @MIN)

You need to use an & to concatenate the 4 macro values <_<

Moved topic

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

No the reason was that i was searching other topics in Iniwrite and while on one that was in general Help i hit new topic

BTW

IniWrite("C:\Temp\myfile.ini", "section2", "key", @username& @MON& @MDAY& @MIN&)

doesnt work either

[Cheeky]Comment[/Cheeky]
Link to comment
Share on other sites

  • Moderators

Guess you're missing the obvious.

You were told to add an ampersand between the strings/macro's you were trying to concatenate the strings together.

So any string, you want to merge:

$sString1 = "I " & "am " & "a " & "string."

$sString2 = "Your username: " & @UserName & " , is this correct?"
MsgBox(64, "info", $sString1 & @CRLF & $sString2)

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

no. i havent figured out

IniWrite("C:\log.ini", "Greating", "Hi","@Username&"Welcome in to the room")

How do i make it so that each time this ini file is written to it appears on the next line without overwriting?

You can't write your ini with the same values in the key in one section... You can count the values ($val = IniReadSection ( "filename", "section" ), the total will be $val[0][0]) then write the key with a number +1 ($total += $val[0][0]). Your " at the start of the value, should not be there, unless you have Opt ("ExpandVarStrings", 1) and the " in the middle removed. We won't go into that. In the end, your code where you write the key should look something like:

IniWrite("C:\log.ini", "Greating", "Hi" & $total, @Username & "Welcome in to the room")

Just use what I suggested, and see how you go <_<

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...