Code: Select all
M1:
GuiControlGet, Date,, MyEdit
if (StrLen(Date) != 4)
return
FormatTime, Date2, Date, MMM.%A_Space%dd,%A_Space%%A_YYYY%
StringUpper, Date2, Date2
GuiControl,, Date1, %Date2%
return
Code: Select all
M1:
GuiControlGet, Date,, MyEdit
if (StrLen(Date) != 4)
return
FormatTime, Date2, Date, MMM.%A_Space%dd,%A_Space%%A_YYYY%
StringUpper, Date2, Date2
GuiControl,, Date1, %Date2%
return
Let's guess the format you've handed over isn't valid. So the output will be the default AKA the current date.If blank or omitted, it defaults to the current time. Otherwise, specify the time to use for the operation ...
Code: Select all
M1:
Gui, Submit, NoHide
FormatTime, Date2,% yyyy . Date . "000000", MMM. dd, yyyy
MsgBox % Date2
Return
Code: Select all
M1:
GuiControlGet, Date,, MyEdit
if (StrLen(Date) != 4)
return
MsgBox % Date ;while type 0901 in Editbox "MyEdit", msgbox prompt "0901"
FormatTime, Date2,% yyyy . Date . "000000", MMM. dd, yyyy
StringUpper, Date2, Date2
MsgBox % Date2 ;msgbox prompt empty
GuiControl,, Date1, %Date2%
return
ivill wrote:<It's not working!>Code: Select all
M1: GuiControlGet, Date,, MyEdit if (StrLen(Date) != 4) return MsgBox % Date ;while type 0901 in Editbox "MyEdit", msgbox prompt "0901" FormatTime, Date2,% yyyy . Date . "000000", MMM. dd, yyyy StringUpper, Date2, Date2 MsgBox % Date2 ;msgbox prompt empty GuiControl,, Date1, %Date2% return
FormatTime, Date2,% yyyy . Date . "000000", MMM. dd, yyyy ; wrong
Code: Select all
Gui, Add, Text, x10 y25, Date:
Gui, Add, Edit, x85 y25 W70 h20 number vMyEdit gM1
Gui, Add, Text, x10 y50, D:
Gui, Add, Edit, x85 y50 w352 h20 ReadOnly vDate1
Gui, Show,,
Return
M1:
Gui, Submit, NoHide
GuiControlGet, Date,, MyEdit
if (StrLen(Date) != 4)
return
FormatTime, Date2, yyyy . Date . "000000", MMM. dd, yyyy
StringUpper, Date2, Date2
MsgBox % Date2
GuiControl,, Date1, %Date2%
return
ivill wrote:BoBo wrote:@BoBo somehow it still... not working, could you have a try on the test script:
[...]
Code: Select all
#SingleInstance, Force
Gui, Add, Text, x10 y25 , Date:
Gui, Add, Edit, x85 y25 w70 h20 number vDate gM1 , 090
Gui, Add, Text, x10 y50 , D:
Gui, Add, Edit, x85 y50 w352 h20 ReadOnly vDate1
Gui, Show,,`t
Return
M1:
Gui, Submit, NoHide
If (StrLen(Date) != 4)
Return
FormatTime, Date2,% A_YYYY . Date , MMM. dd, yyyy
StringUpper, Date2, Date2
GuiControl,, Date1,% Date2
Return
F10::Reload
Fantastic! thank you, anyway, Congrats on your level up to be the mod of "Ask for help"BoBo wrote:ivill wrote:BoBo wrote:@BoBo somehow it still... not working, could you have a try on the test script:
[...]Tested.Code: Select all
#SingleInstance, Force Gui, Add, Text, x10 y25 , Date: Gui, Add, Edit, x85 y25 w70 h20 number vDate gM1 , 090 Gui, Add, Text, x10 y50 , D: Gui, Add, Edit, x85 y50 w352 h20 ReadOnly vDate1 Gui, Show,,`t Return M1: Gui, Submit, NoHide If (StrLen(Date) != 4) Return FormatTime, Date2,% A_YYYY . Date , MMM. dd, yyyy StringUpper, Date2, Date2 GuiControl,, Date1,% Date2 Return F10::Reload
Users browsing this forum: bobstoner289, Ralf_Reddings200244 and 296 guests