Jump to content
Diana (Cda)

_DateMonthOfYear removed from DATE.au3 UDF?

Recommended Posts

Diana (Cda)

Good Morning!

New OS (Win10) after nearly a year on Linux.  Only reason I'm back on Window$ is because even though I did so much prefer the solidity of Linux, unfortunately, my productivity went way down due to lack of applications, a huge one being the supreme desktop automation provided by AI!! <sigh>  [Linux did allow me to continue on the failing box for an extra 10 months or so, so it  was a good experience.]

However, just curious about something - anyone know why _DateMonthOfYear would have been removed from the DATE.AU3 UDF?

Here is the error I was getting (I did extract the lines from an old DATE.AU3 to the new one.  Too much for me to re-write the scripts themselves):

Line 37 ...

$monthMmm   = _DateMonthOfYear ( @MON, 1 )
$monthMmm   = ^ERROR

Error:  Unknown function name.

 

I delay upgrading because a huge chunk of my scripts always get broken.  But this DATE.AU3 issue was a doozy as about a fifth of all my scripts call a date function.  So just curious as to why it would have been removed sometime in the last few updates?

Thx!

Share this post


Link to post
Share on other sites
water

First we need some more information! Which version of AutoIt are you talking about?


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites
water

Or check this post for the code:

 


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites
AutoBert

better this one:

you marked it as solved.

Share this post


Link to post
Share on other sites
Melba23

Diana (Cda),

The function to which water linked seems functionally equivalent to the current _DateToMonth function:

#include <Date.au3>

ConsoleWrite(_DateMonthOfYear(1, 0) & @CRLF)
ConsoleWrite(_DateMonthOfYear(1, 1) & @CRLF)

ConsoleWrite(_DateToMonth(1, 0) & @CRLF)
ConsoleWrite(_DateToMonth(1, 1) & @CRLF)
ConsoleWrite(_DateToMonth(1, 2) & @CRLF)
ConsoleWrite(_DateToMonth(1, 3) & @CRLF)

Func _DateMonthOfYear($iMonthNum, $iShort)
;==============================================
; Local Constant/Variable Declaration Section
;==============================================
    Local $aMonthOfYear[13]

    $aMonthOfYear[1] = "January"
    $aMonthOfYear[2] = "February"
    $aMonthOfYear[3] = "March"
    $aMonthOfYear[4] = "April"
    $aMonthOfYear[5] = "May"
    $aMonthOfYear[6] = "June"
    $aMonthOfYear[7] = "July"
    $aMonthOfYear[8] = "August"
    $aMonthOfYear[9] = "September"
    $aMonthOfYear[10] = "October"
    $aMonthOfYear[11] = "November"
    $aMonthOfYear[12] = "December"

    Select
        Case Not StringIsInt($iMonthNum) Or Not StringIsInt($iShort)
            SetError(1)
            Return ""
        Case $iMonthNum < 1 Or $iMonthNum > 12
            SetError(1)
            Return ""
        Case Else
            Select
                Case $iShort = 0
                    Return $aMonthOfYear[$iMonthNum]
                Case $iShort = 1
                    Return StringLeft($aMonthOfYear[$iMonthNum], 3)
                Case Else
                    SetError(1)
                    Return ""
            EndSelect
    EndSelect
EndFunc  ;==>_DateMonthOfYear

The _DateToMonth function has been in Date.au3 since at least 3.3.8.1 (I have no earlier zips available to check) and I rather doubt that the function to which you refer has recently been part of the Date library. However, what version of AutoIt are you running as it may perhaps have been there in a very out-dated version.  Or perhaps you had it in a personal include which you no longer have available since you reinstalled AutoIt?

M23

Edited by Melba23
Added another question

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

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

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.