Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Date functions - Undeclared Identifier 1

Status
Not open for further replies.

mmaxwell

Programmer
Oct 27, 2003
4
0
0
GB
I'm tearing my hair out!

this simple line
Edit1.Text:= InttoStr(DaysInAMonth(2020,2));
gives when I compile
[Error] Unit1.pas(35): Undeclared identifier: 'DaysInAMonth'

However I use the function (& other date functions) I get the same. Help please!

Many thanks

Michael
 
Hi Lou -

No, I haven't. I have not seen this advice anywhere and presumably there are other functions that need mention in the uses clause? Is there a list? I couldn't find it under help (Delphi 7 Enterprise).

Many thanks for your prompt help.

Michael
 
hi

If you F1 on the appropriate function, near the top it should state the appropriate unit it's declared in - the specified unit must be included in your USES clause. Eg. for the DaysIntheMonth, it gives:-

DaysInAMonth function

See also
--------------------------------------------------
Returns the number of days in a specified month of a specified year.

Unit
DateUtils <---- HERE

Category
datetime routines

Delphi syntax:

function DaysInAMonth(const AYear, AMonth: Word): Word;
:
: etc

lou

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top