Klexen Posted November 15, 2007 Posted November 15, 2007 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
Dougiefresh Posted November 15, 2007 Posted November 15, 2007 (edited) 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.") EndIfTry 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 November 15, 2007 by Dougiefresh
Klexen Posted November 15, 2007 Author Posted November 15, 2007 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!
Klexen Posted November 15, 2007 Author Posted November 15, 2007 (edited) 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 November 15, 2007 by Klexen
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