A
at
Гость
Внимательно читал справку, но не нашёл (или не понял), как можно вывести из календаря пораздельно: YYYY, MM, DD и присвоить эти значения переменным $_Day; $_Mons; $_Year.
Прошу подсказать. Делаю так, но не уверен, что правильно.
Прошу подсказать. Делаю так, но не уверен, что правильно.
Код:
#include <ButtonConstants.au3>
#include <DateTimeConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$_Form = GUICreate("Form1", 201, 136, 192, 114)
$_Date = GUICtrlCreateDate("2012/12/13 19:07:3", 32, 24, 138, 21)
$_Button = GUICtrlCreateButton("Button1", 40, 72, 115, 25)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $_Button
$DTM_SETFORMAT_ = 0x1032
$_Style = "yyyyMMdd"
GUICtrlSendMsg($_Date, $DTM_SETFORMAT_, 0, $_Style)
$_String_Date = GUICtrlRead($_Date)
$_Year = StringLeft($_String_Date, 4)
$_Month = StringMid($_String_Date, 5, 2)
$_Day = StringMid($_String_Date, 7, 2)
$_Format_Date = StringFormat('%s%s%s', $_Year, $_Month, $_Day)
ConsoleWrite($_String_Date & ' = ' & $_Format_Date & @CRLF )
EndSwitch
WEnd