Jump to content

_DateMonthOfYear removed from DATE.au3 UDF?


Recommended Posts

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!

Link to comment
Share on other sites

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

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

Or check this post for the code:

 

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

  • Moderators

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

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see 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

 

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...