Function for Current Week of Month
The global variable GameDay can be used to return the current week of a month.
SyntaxEdit
Int Function GetCurrentWeekOfMonth(Int aiCurrentDay)
return (aiCurrentDay / 7) + 1 as int
EndFunction
Return ValueEdit
- The current week of this month.
ExamplesEdit
GlobalVariable property GameDay auto
Event OnInit()
debug.trace("Current week of this month is: " +GetCurrentWeekOfMonth(GameDay.GetValue() as int))
EndEvent
NotesEdit
- Week 1 is represented as 1 and week 4 is presented as week 5. Remove +1 if you want week 1 and 4 to be 0 and 4 respectively.