ale1981 Posted October 27, 2014 Share Posted October 27, 2014 Just out of curiosity, which of these would be quicker or which is correct to use? Local $cDate = _GUICtrlDTP_GetSystemTime( GUICtrlGetHandle($txtDESPDATE) ) $DESPDATE = $cDate[0] & $cDate[1] & $cDate[2] OR Local $cDate = _GUICtrlDTP_GetSystemTime( GUICtrlGetHandle($txtDESPDATE) ) $DESPDATE = StringLeft( _ArrayToString( $cDate, "" ), 8 ) Thanks Link to comment Share on other sites More sharing options...
jguinch Posted October 27, 2014 Share Posted October 27, 2014 (edited) $txtDESPDATE seems to be a date control. You can use GUICtrlSendMsg($txtDESPDATE, $DTM_SETFORMATW, 0, "yyyyMMdd") to have the good format directly with GUICtrlRead : #include <DateTimeConstants.au3> #include <GuiDateTimePicker.au3> GUICreate("", 250, 80) $txtDESPDATE = GUICtrlCreateDate("date", 10, 10) GUICtrlSendMsg($txtDESPDATE, $DTM_SETFORMATW, 0, "yyyyMMdd") $button = GUICtrlCreateButton("Get time", 10, 50, 100, 25) GUISetState() While 1 $msg = GUIGetMsg() If $msg = -3 Then Exit If $msg = $button Then MsgBox( 0, "", GUICtrlRead($txtDESPDATE) ) WEnd To answer to you question, i would say the first way is faster Edited October 27, 2014 by jguinch Spoiler Network configuration UDF, _DirGetSizeByExtension, _UninstallList Firefox ConfigurationArray multi-dimensions, Printer Management UDF Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted October 27, 2014 Moderators Share Posted October 27, 2014 As for which is "correct", I would use the latter if you want the entire array in the string. I would use the former if I wanted to concatenate only certain elements of an array (0, 1, 3 but not 2, 4, or 5, for example). As far as which would be faster...try it. "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...
ale1981 Posted October 27, 2014 Author Share Posted October 27, 2014 Thanks guys, just thought I would put it out there, I will experiment. Thanks for the suggestion jguinch I will give that a go. 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