home *** CD-ROM | disk | FTP | other *** search
/ Media Share 9 / MEDIASHARE_09.ISO / batch / sw_43.zip / SW43DEMO.BAT < prev   
DOS Batch File  |  1992-07-11  |  8KB  |  303 lines

  1. @ECHO OFF
  2. rem A pre-SW screen just for effect
  3. rem make sure the screen is default white on black
  4. rem reset border
  5. sw /o
  6. rem save existing prompt
  7. set sav=%prompt%
  8. rem make sure there was room in environment
  9. if not %sav%!==%prompt%! goto skip
  10. set prompt=$e[0m$p$g
  11. @echo on
  12. cls
  13. @echo off
  14. echo.
  15. echo.
  16. echo.
  17. echo.
  18. echo.
  19. echo.
  20. echo.
  21. echo                           Are Your Batch Files Dull?
  22. echo.
  23. echo                                    Lifeless?
  24. echo.
  25. echo                                     Boring?
  26. echo.
  27. echo                              SW.EXE is the answer!
  28. echo.
  29. echo.
  30. echo.
  31. echo.
  32. echo.
  33. echo.
  34. echo.
  35. echo.
  36. pause
  37. set prompt=%sav%
  38. set sav=
  39.  
  40. :skip
  41. rem skip over screen definitions
  42. rem Put screen definitions at the beginning of the file for fastest execution
  43. goto begin
  44.  
  45. rem Screen definition with default label
  46. rem Windows are drawn in the order defined. Pause, Query and User Input will
  47. rem occur as they are encountered. SW will return only the last Query result.
  48.  
  49. :Display
  50. _window /kcya┼ /r2 /s /bred /w /0 /z
  51. SW.EXE - Expanded Text Handling!
  52. /tWHI+ Multiple Windows!
  53. /m  v 4.3 
  54. _window /r10 /s /bwhi /gblu /l1 /fred /0
  55. /tBLU Optional Command Line Syntax:
  56. SW @filename [label]
  57. _window /r16 /s /bwhi /gblu /l1 /fred /0
  58. /tBLU SW 4.x ADDITIONAL FEATURES
  59. /tred /─
  60. /jl "- Define the entire screen with multiple windows   "
  61.   using external text files.
  62. _window /r25 /l0 /0 /p100- /d
  63. " - Press any key for more - "
  64. _window /r19 /bwhi /gblu /l0 /jl /0 /p100-
  65. "- Using labels, more than one definition can be    "
  66.   included in the same file.
  67. _window /r19 /bwhi /gblu /l0 /jl /0 /p100-
  68. "- The screen definition can be included inside the "
  69.   calling batch file!
  70. _window /r19 /bwhi /gblu /l0 /jl /0 /p100-
  71. "- SW can evaluate Environment Variables included   "
  72.   inside screen definitions.
  73. _window /r19 /bwhi /gblu /l0 /jl /0 /eblu+ /a1 /p100-
  74. "- ~N~E~W~!  Screen definitions can be "nested" to      "
  75.   allow use of the same def for different screens.
  76. _window /r19 /bwhi /gblu /l0 /jl /0 /eblu+ /a2 /p100-
  77. "- ~N~E~W~!  SWV.EXE Text File Viewer available when    "
  78.   registering SW / DI.
  79. _window /r19 /bwhi /gblu /l0 /jl /0 /eblu+ /a3
  80. "- ~N~E~W~!  SW-DIR.EXE File Picker available when      "
  81.   registering SW / DI.
  82. _window /r25 /l0 /0 /p200- /d
  83. " - Press any key to continue - "
  84. :end_display
  85.  
  86. rem screen definition showing a menu with user defined label
  87.  
  88. :Snd_menu
  89. _window /kcya▐▄▀▄▀▄▀▌ /kCYA /r3 /s /bred /w /0 /z
  90. SW.EXE - Sounds!
  91. /m " v 4.3 "
  92. _window /eRED /r11 /s /l1 /w
  93. /mc ┤ Play a Sound ├
  94. "~Low Tone   ~Mid Tone   ~High Tone"
  95. "Bweep ~1    Bweep ~2    ~Bomb     "
  96. "~Siren      ~Phasor     ~Tweeter  "
  97. /tYEL /─
  98. Close ~Encounters   ~Charge 
  99. ~WZLX
  100. /m < ~E~S~C >
  101. :end_Snd_menu
  102.  
  103. rem screen definition showing a menu with another user defined label
  104.  
  105. :4.3
  106. _window /kwhi░▒▓ /r4 /bred /w /0 /o /z
  107. SW.EXE - Bye, Bye ECHO!
  108. /m  v 4.3 
  109. _window /tRED /r11 /fWHI
  110. They can also be placed anywhere on the screen they'll fit!
  111. _window /c1 /r1 /tCYA /fBLU /bcya /l1 /0 /s1
  112. Upper Left
  113. _window /c71 /r1 /tMAG /fGRE /bmag /l1 /0 /s2
  114. Upper Right
  115. _window /c71 /r23 /tblu /fBLA /bgre /l1 /0 /s4
  116. Lower Right
  117. _window /c1 /r23 /tcya /fMAG /byel /l1 /0 /s3
  118. Lower Left
  119. _window /r18 /fWHI /tYEL+ /b4 /l5
  120. (c) 1992   Warren Small
  121. _window /r25 /l0 /0 /p100-
  122. " - Pausing 10 seconds - "
  123. _window /r25 /l0 /0 /p2
  124. " - or less! - "
  125. :end_4.3
  126.  
  127. :Charge
  128. _window /aC4,2
  129. _window /aF4,2
  130. _window /aA4,2
  131. _window /aC5,4
  132. _window /aA4,2
  133. _window /aC5,5
  134. :End_Charge
  135.  
  136. :Close
  137. _window /aA4,3
  138. _window /aB4,3
  139. _window /aG4,3
  140. _window /aG3,3
  141. _window /aD4,10
  142. :End_Close
  143.  
  144. :WZLX
  145. _window /aE5
  146. _window /aG5
  147. _window /aB5
  148. _window /aE6
  149. _window /aB5
  150. _window /aG5
  151. _window /aE5
  152. :End_WZLX
  153.  
  154. rem labels for Alert sounds demos near the beginning of file 
  155. rem for faster execution
  156.  
  157. :beep1
  158. sw /a1
  159. goto BeepDemo
  160.  
  161. :beep2
  162. sw /a2
  163. goto BeepDemo
  164.  
  165. :beep3
  166. sw /a3
  167. goto BeepDemo
  168.  
  169. :beep4
  170. sw /a4
  171. goto BeepDemo
  172.  
  173. :beep5
  174. sw /a5
  175. goto BeepDemo
  176.  
  177. :beep6
  178. sw /a6
  179. goto BeepDemo
  180.  
  181. :beep7
  182. sw /a7
  183. goto BeepDemo
  184.  
  185. :beep8
  186. sw /a8
  187. goto BeepDemo
  188.  
  189. :beep9
  190. sw /a9
  191. goto beepdemo
  192.  
  193. :beep10
  194. sw @sw43demo.bat charge
  195. goto beepdemo
  196.  
  197. :beep11
  198. sw @sw43demo.bat close
  199. goto beepdemo
  200.  
  201. :beep12
  202. sw @sw43demo.bat WZLX
  203. goto beepdemo
  204.  
  205. rem Alternate errorlevel check using FOR loop
  206.  
  207. :beepdemo
  208. sw /q~lmh12bsptcew
  209. for %%e in (1 2 3 4 5 6 7 8 9 10 11 12) do if errorlevel %%e goto beep%%e
  210. if errorlevel 0 goto DI
  211.  
  212. rem Command line examples, positioning, colors, shadows, pause, Wide edge
  213. rem Color numbers are used to shorten the line
  214. rem Command line cannot exceed 128 characters
  215.  
  216. :begin
  217. sw /kwhi /r2 /s /bred "SW.EXE - Enhance Your Batch Files!" /0 /w /m " v 4.3 " /o /z
  218. sw /r10 /l1 /bcya /fRED "In it's simplest form, SW displays your text" "in a window in the center of the screen."
  219. sw /r18 /l3 /t11 "Display up to 20 lines" /t14 "- each with its own color -" /t12 "in one window!" /0
  220. sw /r25 /l0 /0 " - Press any key to continue - " /p100-
  221.  
  222. rem More command line examples, justify, borders
  223.  
  224. sw /kcya░ /r2 /s /bred "SW.EXE - Add Color to Your BAT's!" /tYEL "So easy to use!" /w /0 /m " v 4.3 " /z
  225. sw /fbla /byel /l4 /r10 "Other parameters allow different window colors," "double spacing, and 5 different borders" /2
  226. sw /b7 /r19 /g4 /l "Clear the screen with color" "using an optional character for texture" "& make windows with shadows." /0 /s
  227. sw /bwhi /r19 /gyel /l0 /0 /c4 /jl " Justify " " Text" " Left"
  228. sw /bwhi /r19 /gyel /l0 /0 /c66 /jr " Justify " "Text " "Right "
  229. sw /r25 /l0 /0 " - Press any key to continue - " /p100-
  230.  
  231. set colr=bla
  232. rem Make sure there was room in the environment
  233. if not "%colr%"=="bla" goto next
  234.  
  235. rem Another command line example, Query with default, Border Message, Draw
  236. rem Draw a full screen window
  237. sw /r125 /c180 /o1 " "
  238. sw /r3 /s /bred "SW.EXE - Flow Control for BAT's!" /w /0 /m " v 4.3 " /z
  239.  
  240. rem The following line is longer than 128 characters BUT it works because 
  241. rem when the line is processed by DOS, the %colr% variable is replaced by
  242. rem the color value making the command line 3 characters shorter.
  243.  
  244. :colors
  245. sw /e12 /r13 /b%colr% /s /mc /t14 "▌ Pick a Color ▐" "~Brown  ~Cyan  ~White  ~Green" "Press ~E~S~C to go on..." /q~bcwg /2 /l5 /d
  246.  
  247. if errorlevel 4 set colr=gre
  248. if errorlevel 4 goto colors
  249. if errorlevel 3 set colr=whi
  250. if errorlevel 3 goto colors
  251. if errorlevel 2 set colr=cya
  252. if errorlevel 2 goto colors
  253. if errorlevel 1 set colr=yel
  254. if errorlevel 1 goto colors
  255.  
  256. :next
  257. set colr=
  258.  
  259. rem Display screen definition with default label
  260. sw @sw43demo.bat
  261.  
  262. rem Display screen definition in external file
  263. sw @sw-43.new
  264.  
  265. rem Display screen definition with label 'menu'
  266. sw @sw43demo.bat Snd_menu
  267.  
  268. rem Query is handled separately beacause I wanted to return to the menu
  269. rem after processing the response without redoing the screen.
  270. rem I also placed it nearer the top of the file to speed it up.
  271. goto beepdemo
  272.  
  273. rem create screen definition on the fly to demo DI.EXE
  274. :DI
  275. if exist di.hlp goto DI_Display
  276. sw /r15 /l1 /0 /s /bwhi /fBLU /gblu "Standby!" "Building Next Screen"
  277. echo rem This file was created by SW43DEMO.BAT > di.hlp
  278. echo rem If simply viewing this file, Try the following command at the DOS prompt >> di.hlp
  279. echo rem                       "SW @DI.HLP" >> di.hlp
  280. echo.>> di.hlp
  281. echo :Display >> di.hlp
  282. echo _window /kmag▒─┼─▒ /s /bred /r2 /0 /w >> di.hlp
  283. echo SW.EXE - Now with DI!>> di.hlp
  284. echo /mc  v 4.3 >> di.hlp
  285. echo _window /jl /s /0 /r9 >> di.hlp
  286. echo /mc  Disk Information >> di.hlp
  287. echo.>> di.hlp
  288. di >> di.hlp
  289. echo. >> di.hlp
  290. echo /m "╡ Press any key to continue ╞">> di.hlp
  291. echo _window /r25 /bblu /l0 /0 /p300- >> di.hlp
  292. echo :End_Display >> di.hlp
  293. :DI_Display
  294. sw @di.hlp
  295.  
  296. rem Display screen definition with label '4.3'
  297. :final
  298. sw @sw43demo.bat 4.3
  299.  
  300. rem display help screen
  301. :help
  302. sw
  303.