Morghel Posted June 26, 2013 Share Posted June 26, 2013 Hello! I'm having troubles with this function I made. Func CancellaOrdini() Local $file = FileOpen("OTps Trend.csv", 1) $time = @HOUR & ":" & @MIN & ":" & @SEC & "." & @MSEC ToolTip("Cancella Tutti gli Ordini", 125, 0) FileWrite($file, $date) FileWrite($file, ",") FileWrite($file, $time) FileWrite($file, ",") FileWrite($file, "0") FileWrite($file, ",") FileWrite($file, "1" & @CRLF) FileClose($file) EndFunc ;==>Cancella tutti gli Ordini What it does: when I press a key on the keyboard It opens a csv file and adds a time stamp with some other values and it closes the file right after. This csv is then read by another program. It works perfectly as it is but due to a bug in the program that needs this csv I need to add a 1sec to that timestamp. How can I achieve that? Thanks a lot for the help Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted June 26, 2013 Moderators Share Posted June 26, 2013 (edited) Not sure I'm understanding you. If you need just to add one second to your time, you can do this: $timeplusone = @HOUR & ":" & @MIN & ":" & @SEC + 1 & "." & @MSEC Otherwise, can you explain further what you try to accomplish? Edited June 26, 2013 by JLogan3o13 "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
DW1 Posted June 26, 2013 Share Posted June 26, 2013 Maybe something like this? #include <date.au3> Func CancellaOrdini() Local $file = FileOpen("OTps Trend.csv", 1) $aDateTime = StringSplit(_DateAdd('s', 1, _NowCalc()), ' ') $date = $aDateTime[1] $time = $aDateTime[2] & '.' & @MSEC ToolTip("Cancella Tutti gli Ordini", 125, 0) FileWrite($file, $date & ',' & $time & ',0,1' & @CRLF) FileClose($file) EndFunc ;==>CancellaOrdini AutoIt3 Online Help Link to comment Share on other sites More sharing options...
water Posted June 26, 2013 Share Posted June 26, 2013 Something like this? Func CancellaOrdini() Local $file = FileOpen("OTps Trend.csv", 1) $time = @HOUR & ":" & @MIN & ":" & @SEC + 1 & "." & @MSEC ToolTip("Cancella Tutti gli Ordini", 125, 0) FileWriteLine($file, $date & "," & $time & ",0,1") FileClose($file) EndFunc ;==>Cancella tutti gli Ordini My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted June 26, 2013 Moderators Share Posted June 26, 2013 Three working answers in less than two minutes, what other forum can say that! DW1 1 "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
water Posted June 26, 2013 Share Posted June 26, 2013 There seem to be a lot of people with spare time My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki Link to comment Share on other sites More sharing options...
Morghel Posted June 26, 2013 Author Share Posted June 26, 2013 Thanks a lot for the help guys <3 I will test out every solution and get back to you. Link to comment Share on other sites More sharing options...
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