Jump to content

Recommended Posts

Posted (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 by jguinch
  • Moderators
Posted

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!

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...