Help with simple function

 

Can anyone help me to create a function to test for first day of the month?

I have code below but i can not seem to get it to compile.

 // IsFirstOfMonth
 //
 bool IsfirstOfMonth()
 {
  
   
   datetime now.srv = TimeCurrent();
   int now.dom = TimeDay(now.srv);
   
   if (now.dom == 1) // First day of the month
   
   return( true );
   }

Thanks

Neil

 
Paxman:

Can anyone help me to create a function to test for first day of the month?

I have code below but i can not seem to get it to compile. 

  1. Of course, it won't compile — you can't use dots (and new/delete/class/etc.) in variable names since build 600 and Higher - 2014.02.03

  2. You used TimeDay( TimeCurrent() ). You could have also just used:

     bool IsfirstOfMonth(){ return Day() == 1; }

 
William Roeder:
  1. Of course, it won't compile — you can't use dots (and new/delete/class/etc.) in variable names since build 600 and Higher - 2014.02.03

  2. You used TimeDay( TimeCurrent() ). You could have also just used:


Ah yes sorry it was an old forum post i found this on and did not think to check.

Thank You.