Function for Current Week of Month
Revision as of 11:37, 31 August 2017 by imported>Lisselli (→Syntax)
The global variable GameDay can be used to return the current week of a month.
Syntax[edit | edit source]
Int Function GetCurrentWeekOfMonth(Int aiCurrentDay)
return (aiCurrentDay / 7) + 1 as int
EndFunction
Return Value[edit | edit source]
- The current week of this month.
Examples[edit | edit source]
GlobalVariable property GameDay auto
Event OnInit()
debug.trace("Current week of this month is: " +GetCurrentWeekOfMonth(GameDay.GetValue() as int))
EndEvent
Notes[edit | edit source]
- 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.