Loading |
VBScript |
JavaScript |
Powershell |
Search Options: 2008 Scripting Games Advanced VBScript Event 9Content of 2008 Scripting Games Advanced VBScript Event 9.vbsMD5 Hash: 39B9CF13A57B7D077C44B7CB193D03F9 |
||
' 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, iCount2 Dim sLine, arrWords, sTmpWord, sResult, strFile strFile = "C:\Scripts\alice.txt" If ofso.FileExists(strFile) then Dim oFile : Set oFile = ofso.OpenTextFile(strFile, ForReading) sLine = oFile.ReadAll oFile.Close End if If sLine > "" then arrWords = Split(sLine, " ", -1, 1) For iCount = 0 to UBound(arrWords) sTmpWord = "" For iCount2 = 1 to Len(arrWords(iCount)) sTmpWord = sTmpWord & Left(Right(arrWords(iCount), iCount2), 1) Next sResult = sResult & sTmpWord & " " Next sResult = left(sResult, Len(sResult) -1) Wscript.echo sResult End if End Sub | ||
© 2008 - 2013 Boris Toll :: Scripts available: 6.481 :: :: scriptbox.toll.at :: :: powered by www.toll.at :: |