Created
May 20, 2011 07:52
-
-
Save taka2/982518 to your computer and use it in GitHub Desktop.
VBScriptでsleepソート
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
' test.vbs | |
Set wshell = CreateObject("WScript.Shell") | |
Set args = WScript.Arguments | |
For i=0 to args.Count - 1 | |
wshell.Run "wscript test2.vbs " & args(i), 0, False | |
Next | |
'test2.vbs | |
Dim val | |
val = WScript.Arguments(0) | |
WScript.Sleep(val * 500) | |
WScript.Echo(val) | |
'実行 | |
cscript test.vbs 5 2 1 4 3 | |
'結果 | |
メッセージボックスが1, 2, 3, 4, 5の順であがってくるはず。 | |
(Sleepが短いとソートに成功しません。。) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment