jeweetwel Posted October 24, 2012 Share Posted October 24, 2012 Hello, I'm new to AutoIt... I´m a bit lost. ... Is there any way to extract the month from the date and time picker? I created a dtpicker: $date_now = @MDAY&"-"&@MON&"-"&@YEAR $MonthCal1 = GUICtrlCreateMonthCal($date_now, 16, 16, 193, 180) When the user chooses a different date, i want to read it, and, if possible, i want the values seperatly. (day - month - year). I spent several hours trying to find the answer, and this can't be so difficult i guess. (This is very simple in VB..) Anyone??? Thanks in advance, and sorry for the poor english. Best regards, Rody Link to comment Share on other sites More sharing options...
Developers Jos Posted October 24, 2012 Developers Share Posted October 24, 2012 So what did you do to read the value from the date control? Did you use GuiCtrlRead() as shown in the Helpfile Example? Nederlands werkt ook voor mij. SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
jeweetwel Posted October 24, 2012 Author Share Posted October 24, 2012 Hello (hallo) Jos, Bedankt voor je reactie. Ja, heb ik gedaan, dat werkt ook wel, maar hoe haal ik de maand uit de datum?? Voel me lullig dit te moeten vragen overigens. Ben nog nooit echt met auto it bezig geweest, nu probeer ik het weer een beetje op te pakken, maar dat kost zo meer tijd dan ik er mee ga besparen..... Gr, Rody Link to comment Share on other sites More sharing options...
Developers Jos Posted October 24, 2012 Developers Share Posted October 24, 2012 Something to play with: #include <GUIConstantsEx.au3> Example() Func Example() Local $Date, $msg GUICreate("Get date", 210, 190) $Date = GUICtrlCreateMonthCal("1953/03/25", 10, 10) GUISetState() ; Run the GUI until the dialog is closed or timeout Do $msg = GUIGetMsg() Until $msg = $GUI_EVENT_CLOSE ConsoleWrite('Returned Date = ' & GUICtrlRead($Date) & @CRLF) $adate = StringSplit(GUICtrlRead($Date), "/") ConsoleWrite(" Year=" & $adate[1] & @CRLF) ConsoleWrite(" Month=" & $adate[2] & @CRLF) ConsoleWrite(" Day=" & $adate[3] & @CRLF) EndFunc ;==>Example Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
jeweetwel Posted October 24, 2012 Author Share Posted October 24, 2012 Hello Jos, Thanks a lot. I see you split the "string". There is no other function available in AutoIt to do this like in VB? This will help me a lot by the way, thanks for sharing. Best regards, (met vriendelijke groet), Rody Link to comment Share on other sites More sharing options...
Developers Jos Posted October 24, 2012 Developers Share Posted October 24, 2012 (edited) Sure there are many other options: _StringBetween() StringRegExp() StringInstr() + StringMid() ..but just used this one this time as it seemed to be the easiest one, which by the way is also available in VB (SPLIT()) Groet, Jos Edited October 24, 2012 by Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
skin27 Posted October 24, 2012 Share Posted October 24, 2012 (edited) Rody, welke functie's gebruik je dan in VB? Edited October 24, 2012 by skin27 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