Option Explicit Sub Main( Opt, AppKey ) Dim o : Set o = new InputCommandOpt Set o.CommandReplace = Dict(Array( "1","T_NestPos1" )) InputCommand o, Empty, Opt, AppKey Pass End Sub '******************************************************************************** ' <<< [T_NestPos1] >>> '******************************************************************************** Sub T_NestPos1( Opt, AppKey ) EchoTestStart "T_NestPos1" Dim pos : Set pos = new NestPos Assert IsSameArray( pos.PosArr, Array( 0 ) ) pos.Start Assert IsSameArray( pos.PosArr, Array( 1, 0 ) ) pos.End_ Assert IsSameArray( pos.PosArr, Array( 1 ) ) pos.Start Assert IsSameArray( pos.PosArr, Array( 2, 0 ) ) pos.Start Assert IsSameArray( pos.PosArr, Array( 2, 1, 0 ) ) pos.End_ Assert IsSameArray( pos.PosArr, Array( 2, 1 ) ) pos.End_ Assert IsSameArray( pos.PosArr, Array( 2 ) ) End Sub '--- start of vbslib include ------------------------------------------------------ '// ここの内部から Main 関数を呼び出しています。 '// また、scriptlib フォルダーを探して、vbslib をインクルードしています '// vbslib is provided under 3-clause BSD license. '// Copyright (C) 2007-2011 Sofrware Design Gallery "Sage Plaisir 21" All Rights Reserved. Dim g_Vers : If IsEmpty( g_Vers ) Then Set g_Vers = CreateObject("Scripting.Dictionary") : g_Vers.Add "vbslib", 4.0 Dim g_debug, g_debug_params, g_admin, g_vbslib_path, g_CommandPrompt, g_fs, g_sh, g_AppKey Dim g_MainPath, g_SrcPath, g_f, g_include_path, i, g_debug_tree, g_debug_process, g_is_compile_debug g_SrcPath = WScript.ScriptFullName : g_MainPath = g_SrcPath SetupVbslibParameters Set g_fs = CreateObject( "Scripting.FileSystemObject" ) Set g_sh = WScript.CreateObject("WScript.Shell") : g_f = g_sh.CurrentDirectory g_sh.CurrentDirectory = g_fs.GetParentFolderName( WScript.ScriptFullName ) For i = 20 To 1 Step -1 : If g_fs.FileExists(g_vbslib_path) Then Exit For g_vbslib_path = "..\" + g_vbslib_path : Next If g_fs.FileExists(g_vbslib_path) Then g_vbslib_path = g_fs.GetAbsolutePathName( g_vbslib_path ) g_sh.CurrentDirectory = g_f If i=0 Then WScript.Echo "Not found " + g_fs.GetFileName( g_vbslib_path ) +vbCR+vbLF+_ "Let's download vbslib "&g_Vers.Item("vbslib")&" and Copy scriptlib folder." : Stop : WScript.Quit 1 Set g_f = g_fs.OpenTextFile( g_vbslib_path,,,-2 ): Execute g_f.ReadAll() : g_f = Empty If ResumePush Then On Error Resume Next CallMainFromVbsLib ResumePop : On Error GoTo 0 End If '--------------------------------------------------------------------------------- Sub SetupDebugTools() set_input "" SetBreakByFName Empty SetStartSectionTree "" End Sub Sub SetupVbslibParameters() '--- start of parameters for vbslib include ------------------------------- '// g_Vers("OldMain") = 1 g_vbslib_path = "scriptlib\vbs_inc.vbs" g_CommandPrompt = 2 g_debug = 0 '// release:0, debug:99, -1:call SetupDebugTools '// MSオフィスやコンパイラがあれば、g_debug を 1 以上にするとデバッガーが使えます。 '// ステップ実行を開始する場所や、変数の値を確認したい場所に、Stop 命令を記述してください。 '--- end of parameters for vbslib include --------------------------------- End Sub '--- end of vbslib include --------------------------------------------------------