Page 1 of 1

Make parameter of Hour(), Second() etc. optional

Posted: Wed Sep 28, 2011 9:44 am
by c4s
This is a really small request, similar as making the start position parameter at FindString() optional...

I'd like the parameters of Second(), Minute(), Hour(), Day() etc. to be optional. By default the functions would simply return the current date. Example:

Code: Select all

Debug Year(Date())  ; Returns 2011

Debug Year()  ; Would also return 2011 and is a little easier to read

Re: Make parameter of Hour(), Second() etc. optional

Posted: Wed Sep 28, 2011 12:31 pm
by infratec
Hi c4s,

if it is only for 'readability', why not use an includefile with some Macros inside.
For example

Code: Select all

Macro CurrentYear()
  Year(Date())
EndMacro

Debug CurrentYear()
So you can build a file with many Macros inside.
If they are not used, they don't disturb your normal program.

Bernd

P.S.: Maybe we should start an includefile with helpfull Macros of all users.