Powered by GeSHi

Source code for week.kix

(view source code of week.kix as plain text)

  1. ; Week.kix,  Version 2.10
  2. ; Display week number using Kix
  3. ; Written by Rob van der Woude
  4. ; http://www.robvanderwoude.com
  5.  
  6. ; Number of whole weeks this year (Sundays to Saturdays)
  7. ; Add 1 to start with week 1 instead of 0
  8. ; Thanks to Peter Cranen for this correction
  9. $FULLWEEKS = ( ( @YDAYNO - @WDAYNO ) / 7 ) + 1
  10.  
  11. ; Add 1 week if today isn't Saturday
  12. IF @WDAYNO < 6
  13. 	$WEEKS = $FULLWEEKS + 1
  14. ENDIF
  15.  
  16. ; Display result
  17. ? "Week " + $WEEKS
  18. ?
  19.