OLD | NEW |
(Empty) | |
| 1 FOR /l %%a in (5,-1,1) do (TITLE %title% -- closing in %%as) |
| 2 SET title=%~n0 |
| 3 echo.Hello World |
| 4 @ECHO OFF |
| 5 if not defined ProgressFormat set "ProgressFormat=[PPPP]" |
| 6 EXIT /b |
| 7 set /a ProgressCnt+=1 |
| 8 IF "%~1" NEQ "" (SET %~1=%new%) ELSE (echo.%new%) |
| 9 |
| 10 ---------------------------------------------------- |
| 11 |
| 12 [ |
| 13 ["command", [ |
| 14 ["keyword", "FOR"], |
| 15 ["parameter", ["/l"]], |
| 16 ["variable", "%%a"], |
| 17 ["keyword", "in"], |
| 18 ["punctuation", "("], |
| 19 ["number", "5"], ["punctuation", ","], |
| 20 ["number", "-1"], ["punctuation", ","], |
| 21 ["number", "1"], ["punctuation", ")"], |
| 22 ["keyword", "do"] |
| 23 ]], |
| 24 ["punctuation", "("], |
| 25 ["command", [ |
| 26 ["keyword", "TITLE"], |
| 27 ["variable", "%title%"], |
| 28 " -- closing in ", |
| 29 ["variable", "%%as"] |
| 30 ]], |
| 31 ["punctuation", ")"], |
| 32 |
| 33 ["command", [ |
| 34 ["keyword", "SET"], |
| 35 ["variable", "title"], |
| 36 ["operator", "="], |
| 37 ["variable", "%~n0"] |
| 38 ]], |
| 39 |
| 40 ["command", [ |
| 41 ["keyword", "echo"], |
| 42 ".Hello World" |
| 43 ]], |
| 44 |
| 45 ["operator", "@"], |
| 46 ["command", [ |
| 47 ["keyword", "ECHO"], |
| 48 " OFF" |
| 49 ]], |
| 50 |
| 51 ["command", [ |
| 52 ["keyword", "if"], |
| 53 ["keyword", "not"], |
| 54 ["keyword", "defined"], |
| 55 " ProgressFormat" |
| 56 ]], |
| 57 ["command", [ |
| 58 ["keyword", "set"], |
| 59 ["string", "\"ProgressFormat=[PPPP]\""] |
| 60 ]], |
| 61 |
| 62 ["command", [ |
| 63 ["keyword", "EXIT"], |
| 64 ["parameter", ["/b"]] |
| 65 ]], |
| 66 |
| 67 ["command", [ |
| 68 ["keyword", "set"], |
| 69 ["parameter", ["/a"]], |
| 70 ["variable", "ProgressCnt"], |
| 71 ["operator", "+="], |
| 72 ["number", "1"] |
| 73 ]], |
| 74 |
| 75 ["command", [ |
| 76 ["keyword", "IF"], |
| 77 ["string", "\"%~1\""], |
| 78 ["operator", "NEQ"], |
| 79 ["string", "\"\""] |
| 80 ]], |
| 81 ["punctuation", "("], |
| 82 ["command", [ |
| 83 ["keyword", "SET"], |
| 84 ["variable", "%~1"], |
| 85 ["operator", "="], |
| 86 ["variable", "%new%"] |
| 87 ]], |
| 88 ["punctuation", ")"], |
| 89 ["command", [ |
| 90 ["keyword", "ELSE"] |
| 91 ]], |
| 92 ["punctuation", "("], |
| 93 ["command", [ |
| 94 ["keyword", "echo"], |
| 95 ".", |
| 96 ["variable", "%new%"] |
| 97 ]], |
| 98 ["punctuation", ")"] |
| 99 ] |
| 100 |
| 101 ---------------------------------------------------- |
| 102 |
| 103 Checks for commands. |
OLD | NEW |