Loading |
VBScript |
JavaScript |
Powershell |
Search Options: 2008 Scripting Games Sudden Death Event 4Content of 2008 Scripting Games Sudden Death Event 4.vbsMD5 Hash: A7EA14AD26E5BCC0722895257CB78CFA |
||
' 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 Dim ofso : Set ofso = Createobject("Scripting.FileSystemObject") Const ForReading = 1 Const ForWriting = 2 Const ForAppending = 8 Call Main() ' --------------------------------------- Sub Main() Dim iCount, arrNumbers, strNumbers, strText arrNumbers = ReadFileToArray("C:\Scripts\numbers.txt") If IsArray(arrNumbers) then strNumbers = Trim(arrNumbers(0)) For iCount = 1 to Len(strNumbers) step 2 strText = strText & Chr(Mid(strNumbers, iCount, 2)) Next wscript.echo strText End if End Sub ' --------------------------------------- Private Function ReadFileToArray(strFile) Dim strNextLine, arrstrList Dim arrLines() Dim iCount : iCount = 0 If ofso.FileExists(strFile) then Dim oFile : Set oFile = ofso.OpenTextFile(strFile, ForReading) Do Until oFile.AtEndOfStream Redim Preserve arrLines(iCount) arrLines(iCount) = oFile.ReadLine iCount = iCount + 1 Loop oFile.Close End if Set oFile = nothing If IsArray(arrLines) then ReadFileToArray = arrLines End Function | ||
© 2008 - 2013 Boris Toll :: Scripts available: 6.481 :: :: scriptbox.toll.at :: :: powered by www.toll.at :: |