Loading |
VBScript |
JavaScript |
Powershell |
Search Options: 2008 Scripting Games Advanced VBScript Event 4Content of 2008 Scripting Games Advanced VBScript Event 4.vbsMD5 Hash: 624D6D59B4C451207AF575850350B6CB |
||
' This is my Solution for the Scripting Games 2008
' For more Information look at ' http://www.microsoft.com/technet/scriptcenter/funzone/games/games08.mspx Option Explicit Call Main Sub Main() Dim arrDate, iCount Dim iDate : iDate = InputBox("Please enter a Date","Date") Select Case iDate Case false Case Else If iDate > "" then arrDate = Split(iDate, "/", -1, 1) wscript.echo MonthName(arrDate(0),false) & " " & arrDate(1) wscript.echo "" wscript.echo "Sun Mon Tue Wed Thu Fri Sat" For iCount = 1 to GetDaysofMonth(arrDate(0), arrDate(1)) If iCount = 1 then Select Case GetWeekday(iCount & "/" & arrDate(0) & "/" & arrDate(1)) Case 1 WScript.StdOut.Write iCount Case 2 WScript.StdOut.Write String(6, " ") & iCount Case 3 WScript.StdOut.Write String(12, " ") & iCount Case 4 WScript.StdOut.Write String(18, " ") & iCount Case 5 WScript.StdOut.Write String(24, " ") & iCount Case 6 WScript.StdOut.Write String(30, " ") & iCount Case 7 WScript.StdOut.Writeline String(36, " ") & iCount End Select Elseif iCount < 11 then Select Case GetWeekday(iCount & "/" & arrDate(0) & "/" & arrDate(1)) Case 1 WScript.StdOut.Write iCount Case 2 WScript.StdOut.Write String(5, " ") & iCount Case 3 WScript.StdOut.Write String(5, " ") & iCount Case 4 WScript.StdOut.Write String(5, " ") & iCount Case 5 WScript.StdOut.Write String(5, " ") & iCount Case 6 WScript.StdOut.Write String(5, " ") & iCount Case 7 WScript.StdOut.Writeline String(5, " ") & iCount End Select Else Select Case GetWeekday(iCount & "/" & arrDate(0) & "/" & arrDate(1)) Case 1 WScript.StdOut.Write iCount Case 2 WScript.StdOut.Write String(4, " ") & iCount Case 3 WScript.StdOut.Write String(4, " ") & iCount Case 4 WScript.StdOut.Write String(4, " ") & iCount Case 5 WScript.StdOut.Write String(4, " ") & iCount Case 6 WScript.StdOut.Write String(4, " ") & iCount Case 7 WScript.StdOut.Writeline String(4, " ") & iCount End Select End if Next wscript.echo "" End if End Select End Sub ' ---------------------------------------------- Private Function GetDaysofMonth(sMonth, sYear) GetDaysofMonth = Day(DateSerial(sYear, sMonth + 1, 0)) End Function ' ---------------------------------------------- Private Function GetWeekday(sDate) GetWeekday = Weekday(sDate) End Function | ||
© 2008 - 2013 Boris Toll :: Scripts available: 6.481 :: :: scriptbox.toll.at :: :: powered by www.toll.at :: |