ale1981 Posted October 27, 2014 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
jguinch Posted October 27, 2014 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
Moderators JLogan3o13 Posted October 27, 2014 Moderators 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!
ale1981 Posted October 27, 2014 Author 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.
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