Jump to content
Sign in to follow this  
Klexen

Writing entry to a new line of ini everytime program launches.

Recommended Posts

Klexen

Ok so I found some code that I thought might work, but it just overwrites the first line every time. How can I make it write to a new line every time program opens? Here is what I have...

$val = IniReadSection("F:\files\Training Pics\SuperLaunchUsers.ini","Users")
If @error Then 
;
Else
$total += $val[0][0]
IniWrite("F:\files\Training Pics\SuperLaunchUsers.ini", "Users", $total, @Username & " Has Launched Super Launch.")
EndIf

Share this post


Link to post
Share on other sites
Dougiefresh

Ok so I found some code that I thought might work, but it just overwrites the first line every time. How can I make it write to a new line every time program opens? Here is what I have...

$val = IniReadSection("F:\files\Training Pics\SuperLaunchUsers.ini","Users")
If @error Then 
;
Else
$total += $val[0][0]
IniWrite("F:\files\Training Pics\SuperLaunchUsers.ini", "Users", $total, @Username & " Has Launched Super Launch.")
EndIf
Try this instead to increment the counter:
$total = $val[0][0] + 1

EDIT: Or try this to log the time and date of the launch:

$total = @YEAR & "/" & @MON & "/" & @MDAY & " " & @HOUR & ":" @MIN & ":" & @SEC
IniWrite("F:\files\Training Pics\SuperLaunchUsers.ini", "Users", $total, @Username & " Has Launched Super Launch.")
EndIf
Edited by Dougiefresh

Share this post


Link to post
Share on other sites
Klexen

Try this instead to increment the counter:

$total = $val[0][0] + 1

EDIT: Or try this to log the time and date of the launch:

$total = @YEAR & "/" & @MON & "/" & @MDAY & " " & @HOUR & ":" @MIN & ":" & @SEC
You rock dude! Thanks!

Share this post


Link to post
Share on other sites
Klexen

Ok, I have this code here now.. And it works great!

$val = IniReadSection("F:\files\Training Pics\SuperLaunchUsers.ini", "Users")
If @error Then
    ;
Else
    If @UserName = "jkingsley" Then
        ;
    Else
        $total = $val[0][0] + 1
        IniWrite("F:\files\Training Pics\SuperLaunchUsers.ini", "Users", $total, " " & @UserName & " Has Launched Super Launch at " & _NowTime(1) & " " & _DateTimeFormat(_NowCalc(), 1))
    EndIf
EndIfoÝ÷ ØhºÚn¶ËaÇ(uæèÅK®Í
Edited by Klexen

Share this post


Link to post
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
Sign in to follow this  

×