Sign in to follow this  
Followers 0
ale1981

_ArrayToString or $array[n]

4 posts in this topic




#2 ·  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

Share this post


Link to post
Share on other sites

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. ;)


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

Thanks guys, just thought I would put it out there, I will experiment.

Thanks for the suggestion jguinch I will give that a go.

Share this post


Link to post
Share on other sites

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
Sign in to follow this  
Followers 0