` Printed Icetips Article

Icetips Article



Par2: Last weekday of a month
1997-06-08 -- Robert Rogers
 
!Text Equates
SundayText              Equate('Sunday')
MondayText              Equate('Monday')
TuesdayText             Equate('Tuesday')
WednesdayText        Equate('Wednesday')
ThursdayText            Equate('Thursday')
FridayText                 Equate('Friday')
SaturdayText            Equate('Saturday')


! Numeric Equates
Sunday                  Equate(1)
Monday                 Equate(2)
Tuesday                Equate(3)
Wednesday           Equate(4)
Thursday               Equate(5)
Friday                    Equate(6)
Saturday                Equate(7)
LastDayOfMonth   Long
AnyDate                Long

AnyDate = any given Clarion standard date


LastDayOfMonth = date(month(AnyDate) + 1,1,year(AnyDate)) -1


!Execute some code depening on day of week
Execute (LastDayOfMonth % 7) + 1
        Do SundayRoutine
        Do MondayRoutine
        Do TuesdayRoutine
        Do WednesdayRoutine
        Do ThursdayRoutine
        Do FridayRoutine
        Do SaturdayRoutine
End

! or return a value to a variable
Execute (LastDayOfMonth % 7) + 1
        ?DayText =  SundayText
        ?DayText =  MondayText
        ?DayText =  TuesdayText
        ?DayText =  WednesdayText
        ?DayText =  ThursdayText
        ?DayText =  FridayText
        ?DayText =  SaturdayText
End



Printed November 23, 2024, 10:16 pm
This article has been viewed/printed 35206 times.