Jump to content

Date UDF Didn't Work (from help)


sness
 Share

Recommended Posts

Hi everybody.

I'm just getting started with AutoIt, Trying to call some of the simple commands listed in the Help section of the system. To understand how the UDF's work I want to run the example given under User Defined Functions. The code is two lines long:

#include <date.au3>

MsgBox(0,"Today","Today's date is " & Now())

My script is returning an error on the Now part of the 2nd line, Unknown Function Name.

Do I need to register the functions I plan to use? What am I over looking?

Thanks to you all.

Sue

Link to comment
Share on other sites

Hi everybody.

I'm just getting started with AutoIt, Trying to call some of the simple commands listed in the Help section of the system. To understand how the UDF's work I want to run the example given under User Defined Functions. The code is two lines long:

#include <date.au3>

MsgBox(0,"Today","Today's date is " & Now())

My script is returning an error on the Now part of the 2nd line, Unknown Function Name.

Do I need to register the functions I plan to use? What am I over looking?

Thanks to you all.

Sue

The reason that didn't work seems to be that it's the _Now() function, not the Now() function. All UDF's start with an underscore. The help correctly contains the underscore and a cut&paste of that code works for me...

Roses are FF0000, violets are 0000FF... All my base are belong to you.

Link to comment
Share on other sites

WOW. Thanks. I will give this a try and I'm sure it will work - already learned a boat load.

Sue

Update - yes _Now() did work. I went back to the Help file to check it out - If you look at the TOC under "User Defined Functions" one of the first chapters, the example is there with no underscore. Thanks for you help, it is working perfect with the underscore.

Edited by sness
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...