Jump to content

GUICtrlCreateDate Help Entry Possibly Inccorect


Recommended Posts

I can't seem to figure out how to change the date displayed in a date control created with GUICtrlCreateDate(). In the help file there is a link to the function GUICtrlCreateDateGUICtrlUpdate() that doesn't seem to exist. I assumed that GUICtrlUpdate() was replaced by GUICtrlSetData() but it doesn't seem to work either.

Your help is much appreciated.

Thanks in advance.

Edited by Skizmata

AutoIt changed my life.

Link to comment
Share on other sites

"Date : The date or time depending the style of the control."

From GuiCtrlSetData.

#include <GUIConstantsEx.au3>
#include <DateTimeConstants.au3>
;i

Example1()

; example1
Func Example1()
    Local $date, $msg

    GUICreate("My GUI get date", 200, 200, 800, 200)
    $date = GUICtrlCreateDate("1953/04/25", 10, 10, 185, 20)
    $button_change = GuiCtrlCreateButton("Change this sucker!", 50, 150)
    GUISetState()

    ; Run the GUI until the dialog is closed
    Do
        $msg = GUIGetMsg()
        If $msg = $button_change Then GUICtrlSetData($date, Random(2000,2010,1) & "/" & Random(10,12,1) & "/" & Random(10,28,1))
    Until $msg = $GUI_EVENT_CLOSE

    MsgBox(0, "Date", GUICtrlRead($date))
    GUIDelete()
EndFunc   ;==>Example1

Read HelpFile more carefully :]

Edited by 4ggr35510n
Link to comment
Share on other sites

Thanks so much for the help. This was exactly what I needed.

Aside from the snarky "Read HelpFile more carefully :]" comment.

It would appear that the help file is incorrect and the line "To set or change information in the control see GUICtrlUpdate...." in GUICtrlCreateDate() should be a link to GUICtrlSetData() instead of GUICtrlUpdate(). I know this from a careful reading of the help file.

AutoIt changed my life.

Link to comment
Share on other sites

But inside GuiCtrlUpdate... chapter there was a link to GuiCtrlSetData.

What's more, you have even correctly assumed you need GUISD function, inside which you could find suitable paragraph.

I can't find 'snarky' in any dictionary, so I'll assume that it's a complement ;]

Glad I could help ;)

Edited by 4ggr35510n
Link to comment
Share on other sites

If you would read your dictionary more carefully you would find it. You can find common usage here, http://www.merriam-webster.com/dictionary/snarky. Since I expect a snarky asshole to say some nonsense about online dictionaries I also found it in my print edition of "The Oxford Dictionary of English Etymology" (1966) on page 840 where it says it is of or relating to the imaginary animal in 'Lewis Carroll' (C.L. Dodgson)'s "The Hunting of the Snark".

Anyway, forums are the last vestige of this kind of back handed nonsense soon to be beat out entirely be systems like StackOverflow.com where credibility is built by getting the right answer (as you did) not by provoking more attention (as you also did). Forms foster condescension and arrogance among casual users to try to boost post count. When someone gives a good answer and does it like an arrogant jerk they are improving their odds of having another post to comment on. Since post count gets confused for creditability on these antiquated systems this is a self reinforcing mechanism that has always annoyed me.

Thanks for the help you are very much correct. I don't think I will help bolster your post count any further.

Edited by Skizmata

AutoIt changed my life.

Link to comment
Share on other sites

Thanks so much for the help. This was exactly what I needed.

Aside from the snarky "Read HelpFile more carefully :]" comment.

It would appear that the help file is incorrect and the line "To set or change information in the control see GUICtrlUpdate...." in GUICtrlCreateDate() should be a link to GUICtrlSetData() instead of GUICtrlUpdate(). I know this from a careful reading of the help file.

I don't think the helpfile is wrong, just poorly worded there as "information" implies the data. What they mean is "update an aspect of the control" whether it be the color, text, data, whatever of the control.

010101000110100001101001011100110010000001101001011100110010000

001101101011110010010000001110011011010010110011100100001

My Android cat and mouse game
https://play.google.com/store/apps/details?id=com.KaosVisions.WhiskersNSqueek

We're gonna need another Timmy!

Link to comment
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
 Share

  • Recently Browsing   0 members

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