home *** CD-ROM | disk | FTP | other *** search
/ Media Share 9 / MEDIASHARE_09.ISO / batch / ebl407.zip / BATDEMO.BAT < prev    next >
DOS Batch File  |  1992-01-15  |  18KB  |  578 lines

  1. bat * Loading DEMO .....
  2. *           Written by F.Canova 10/5/83 through 01/25/90
  3. *   (c) Copyright 1983-1990 by Seaware Corp. all rights reserved.
  4. *    This batch file REQUIRES EBL PLUS for proper execution!
  5.  
  6. ********************* NOTE! NOTE! NOTE! NOTE! ********************
  7. %D = 'RAM'    |* <-----Change 'RAM' to 'BIOS' if PC isn't 100% IBM Compatible!
  8. goto -start
  9. * For more information or to receive your own copy of EBL PLUS write to:
  10. *              Seaware Corp.
  11. *              P.O. Box 1656
  12. *              Delray Beach, FL 33444
  13.  
  14. *---- FEATURES OF THE LANGUAGE USED WITHIN THIS DEMO ARE: ----------------
  15. * Standard DOS commands can be intermixed freely with BAT commands.
  16. * Up to 255 chars are allowed for labels, contents of vars, and literals
  17. * 10 variables are provided to be passed to/from DOS. They're %0 to %9.
  18. * 15 variables are provided for EBL PLUS┐ user use only. They're %A to %O.
  19. * The variable %R is a return code that any routine can set at [0:04FE]
  20. * BEGTYPE command can have screen attributes via the COLORCHAR command,
  21. * or the '\hex' format.
  22. * BEGSTACK command can have timing attributes via the KEY(PAUSE) or
  23. * the alternative '\hex' format.
  24. * Spaces are not needed to delimit operators.
  25. * Non-spaces will concatenate variables and literals.
  26. * EXIST() and DIR() set a return code based on state of a file's existence.
  27.  
  28.         ** Now actually do the bouncing bar menu **
  29. -End1    type " Exit to DOS                " | If %A = Enter then goto -Bye
  30. -Endit    %A = select( color( yellow on green), color( black on white ), Arrow)
  31.     if %A = Esc then goto -line0
  32.     if %R = 1 then goto -End1
  33. -End2    if %R = 2 type " Go to on-line documentation" | If %A = Enter then stack "BATDOC" |exit
  34. -End3    if %R = 3 type " Return to EBL Plus demo    " | If %A = Enter then goto -top
  35.        goto -endit
  36.  
  37. -Bye    window( 19, 14, 49, 21)
  38.     type "So long" %F....
  39.     type "P.S. For quickie help,"
  40.     type " just enter 'BAT' from DOS!"
  41.     exit
  42.  
  43. -start
  44.     if %D = 'RAM' then RAM
  45.     else BIOS
  46.  
  47. ** Open the demo with welcome message windows in the shape of a big 'W' **
  48. *   play( o5 t140 ms l8 g4 p >c <b >c p6 <e p6 d p6 b p6 >c..)
  49. *   repeat with %0 = 1 to 27
  50. *    color ((%0 % 8) & "F")
  51. *    if %0 < 7        then %1 = %0 * 2
  52. *       else if %0 < 14  then %1 = (14 - %0) * 2
  53. *       else if %0 < 21  then %1 = (%0 - 13) * 2
  54. *       else          %1 = (28 - %0) * 2
  55. *    window( (%0*2), %1, (%0*2+20), (%1+5), s)
  56. *    type
  57. *    type center("Welcome", 18)
  58. *   end repeat
  59. *   wait until time(2)
  60.  
  61. ** Start by asking who I'm talking to **
  62.     colorchar '=' as color( yellow on white )
  63.     colorchar '@' as color( white on blue )
  64.     colorchar '`' as color( blink white on blue )
  65.     color( black on white )
  66.     cls
  67.     begtype
  68.           =(Non-IBM systems, read NOTE within this file)=
  69.  
  70.   @┌───────────────────────────────────────────────────────────────────────┐@
  71.   @│          EXTENDED BATCH LANGUAGE-PLUS                   │@
  72.   @│                                       │@
  73.   @│    Welcome to the Extended Batch Language Plus Demonstration !       │@
  74.   @│                                       │@
  75.   @└───────────────────────────────────────────────────────────────────────┘@
  76. end
  77. call -asplogo 40 16
  78. color( white on black )
  79. locate 13 10 | Type "What is your first name? ;"
  80. read %F
  81. %7 = 27
  82. %L =
  83. %0 = left( (" " & %F & "'s EBL Plus Sampler Menu"), 47)
  84.  
  85. -top ** Show Master Menu of things that can be shown **
  86.     color( Normal )
  87.     colorchar
  88.     colorchar '@' as color( white on blue )
  89.     colorchar '^' as color( lgray on blue )
  90.     colorchar '#' as color( black on cyan )
  91.     colorchar '&' as color( yellow on red )
  92.     colorchar '*' as color( white on red )
  93.     cls begtype
  94. @════════════════════════════════════════════════@ ^┌─────────────────────────┐^
  95. @ \%0@ ^│ User supported software │^
  96. @════════════════════════════════════════════════@ ^│           by          │^
  97.                            ^│                  │^
  98.                            ^│ Seaware Corp.          │^
  99.  # S #────&Display Screen and String operations  & ^│ P.O. Box 1656          │^
  100.       *                     * ^│ Delray Beach, FL 33444  │^
  101.  # D #────&Directory of available programs     & ^│ 407/738-1712          │^
  102.       *                     * ^│                  │^
  103.  # F #────&Testing for Files             & ^│ Order your registered   │^
  104.       *                     * ^│ copy for $79 from us    │^
  105.  # K #────&Keyboard stack (the invisible fingers)& ^│ directly or our order   │^
  106.       *                     * ^│ line at 800/634-8188    │^
  107.  # C #────&I can Count                 & ^│                  │^
  108.       *                     * ^│ Please copy and share   │^
  109.  # X #────&eXit                  & ^│ BAT.COM, BATDOC.BAT,    │^
  110.                            ^│ and BATDEMO.BAT for     │^
  111.                            ^│ non-commercial uses     │^
  112.                            ^│ only.              │^
  113.                            ^│                  │^
  114.                            ^│ ASP member.          │^
  115. (Select a demo with the cursor and press ─┘)       ^└─────────────────────────┘^
  116. end
  117.     colorchar
  118.     colorchar '@' as color( white on blue )
  119. -Entry
  120.     color( yellow on black)
  121.     %9 = ''
  122.  
  123. -Text.1 *** (C)ount
  124.     locate 1 18
  125.     type " See how EBL Plus makes your screen come alive"
  126.     type " with color and powerful string handling.     "
  127.     if %9 = Enter then call -sgo | goto -top
  128.  
  129. -Choose
  130.     %7 = %7 + 3
  131.     %9 = select(color(yellow on red),color(black on white),Arrow)
  132.  
  133.     if %9 = 'C' then %9 = Enter
  134.     if %9 = 'D' then %9 = Enter
  135.     if %9 = 'F' then %9 = Enter
  136.     if %9 = 'K' then %9 = Enter
  137.     if %9 = 'S' then %9 = Enter
  138.     if %9 = 'X' then %9 = Enter
  139.     locate 1 18
  140.     if %R = 1 then goto -Text.1
  141.     if %R <> 2 then skip 4
  142.     type " See how EBL Plus can work together with your "
  143.     type " application and DOS.                         "
  144.     if %9 = Enter then call -dgo | goto -top
  145.           else goto -Choose
  146.     if %R <> 3 then skip 4
  147.     type " EBL Plus can see files that are created by   "
  148.     type " your programs, or create new ones on it own. "
  149.     if %9 = Enter then call -fgo | goto -top
  150.           else goto -Choose
  151.     if %R <> 4 then skip 4
  152.     type " EBL Plus can automatically control your      "
  153.     type " applications by typing on the keyboard.      "
  154.     if %9 = Enter then call -kgo | goto -top
  155.           else goto -Choose
  156.     if %R <> 5 then skip 4
  157.     type " This is a simple game that shows the math    "
  158.     type " and looping capabilities of EBL Plus.        "
  159.     if %9 = Enter then call -i.can.count | goto -top
  160.           else goto -Choose
  161.     else
  162.     type " Leave this Demo and return to DOS            "
  163.     type "                                              "
  164.     if %9 = Enter then goto -exit
  165.           else goto -Choose
  166.  
  167. *******************************************************************************
  168.  
  169. * number guessing demo *
  170. -i.can.count
  171.     cls type "I am thinking of a two digit number, can you guess it?"
  172.     %J=tries
  173.     %7 = right(%7,2) + 0        |* Limit to just 2 digits!
  174.     repeat with %A = 4 down to 0
  175.     read %5
  176.     if %5 = %7
  177.     begin
  178.         type "Great!  I was afraid you weren't going to get it!"
  179.         exit repeat
  180.     end
  181.     if %A = 1 then %J = try
  182.     if %A = 0
  183.     begin
  184.         type "BOO HISSS!  The number was" %7 "!"
  185.         exit repeat
  186.     end
  187.     if %5 > %7 type "Try a little lower.  You get" %A "more" %J.
  188.     if %5 < %7 type "Try a higher number.  You get" %A "more" %J.
  189.     end repeat
  190.     begtype
  191. @════════════════════════════════════════════════════════════════════════════@
  192.   A BAT program can create loops and count events.  With this you can
  193.   sequence through file numbers, or create loops to do retries in case of
  194.   errors.  The REPEAT commands are handy for this.  EBL programs can even
  195.   do arithmetic (up to 18 digits) and string manipulation (up to 255
  196.   characters mixed case).
  197. @════════════════════════════════════════════════════════════════════════════@
  198.  
  199. Press any key to continue. . .
  200.  
  201. end
  202. inkey
  203. return
  204.  
  205. *******************************************************************************
  206.  
  207. * directory demo *
  208. -dgo
  209.     color( White )
  210.     cls
  211.     type "Enter file.spec for files you would like to see,"
  212.     read or press ENTER for all: %1
  213.     if .%1 = '.' then %1 = '*.*'
  214.     -dirques
  215.     colorchar . as color( yellow on black )
  216.     type "Would you like a .S.tandard or .W.ide directory?"
  217.     select( color(yellow on black))
  218.     colorchar .
  219.     if %R = 2 then %3 = '/w'
  220.        else %3 =
  221.     cls
  222.     type "EBL Plus can work directly with your applications or DOS."
  223.     type "For example, two values are passed to DOS here: %1 and %3"
  224.     shell dir %1 %3 /p
  225.     shell pause
  226.     cls
  227.     begtype
  228. @═════════════════════════════════════════════════════════════════════════@
  229.   This directory was created using the 'DIR' DOS command within this
  230.   batch file.  Any DOS commands can be mixed freely within lines of the
  231.   BAT program and are shelled by default.  Here, to insure EBL understood
  232.   it to be a DOS command, rather than it's own 'DIR' command, another
  233.   'SHELL' was placed before the DOS command.  Alternately, the 'LEAVE'
  234.   command could have been used.  By passing parameters to and from DOS,
  235.   you can have complete control of how a program operates.  User programs
  236.   may also set a return code in order to control batch file execution.
  237. @═════════════════════════════════════════════════════════════════════════@
  238.  
  239. Press any key to continue. . .
  240.  
  241. end
  242. inkey
  243. return
  244.  
  245. *******************************************************************************
  246.  
  247. *files demo
  248. -fgo
  249.     cls type Enter a file name to search.
  250.     read %E
  251.     -is.f if .%E = '.' then goto -fgo
  252.     type Scanning for file: %E . . .
  253.     * this will set the return code up (%R)
  254.     if exist( %E ) then type The file does exist - exactly as typed.
  255.     else
  256.     begin
  257.      type The file does not exist in the current subdirectory.
  258.      -srch
  259.          type Would you like to search another subdirectory
  260.          read or drive (y/n)? %B
  261.          if %B <> y then if %B <> n goto -srch
  262.          if %B <> y then cls | skip 5
  263.      -is.f2
  264.          cls type "Enter path and filename (ex. c:\subdir\filename.ext):"
  265.          read %E
  266.          if .%E = '.' then goto -is.f2
  267.          goto -is.f
  268.     end
  269.     begtype
  270.  
  271. @═══════════════════════════════════════════════════════════════════════════@
  272.       File searching is done by the commands called DIR and EXIST.
  273.  
  274.   If the file was there, we could direct a program to use it, even if it
  275.   wasn't on the specific diskette drive that the operator was expecting.
  276.  
  277.   If the file was not there, we could have printed out an error message
  278.   to the operator, or we could have run an alternate program in order to
  279.   create the missing file.
  280.  
  281.   Extended Batch Language Plus┐ can also read and write files.    This is
  282.   useful for making configuration files, setting up printers, etc.
  283. @═══════════════════════════════════════════════════════════════════════════@
  284.  
  285. Press any key to continue . . .
  286.  
  287. end
  288. inkey
  289. return
  290.  
  291. *******************************************************************************
  292.  
  293. * keyboard stack demo
  294. -kgo
  295. cls begtype
  296.  
  297. ╔═════════════════════════════════════════════════════════════════════════════╗
  298. ║                                          ║
  299. ║    The keyboard stack can answer questions to programs automatically.       ║
  300. ║    For example, this DOS command is being answered by the keyboard stack.   ║
  301. ║                                          ║
  302. ╚═════════════════════════════════════════════════════════════════════════════╝
  303. end
  304. begstack
  305. This text is actually being typed for you from the keyboard stack.
  306. All keys, including control keys and function keys can come from this stack.
  307. end
  308.     key( "Keystrokes can" )
  309.     key(pause)
  310.     key( " even" )
  311.     key(pause)
  312.     key( " have" )
  313.     key(pause)
  314.     key( " delayed" )
  315.     key(pause)
  316.     key( " typing. " )
  317.     Key(ctrl-z)
  318.     key(enter)
  319.     stack.on  |* This makes sure copy can see our stack contents.
  320.     * Below is the DOS command that will read the keyboard stack. *
  321. copy con: nul:
  322. begtype
  323.  
  324. Press any key to continue. . .
  325.  
  326. end
  327. inkey
  328. return
  329.  
  330. *******************************************************************************
  331. * screen attributes and strings demo
  332. -sgo
  333. colorchar '^' as color( high-intensity on black )
  334. colorchar '~' as color( red on black )
  335. colorchar '`' as color( blue on green )
  336. colorchar '&' as color( Blink LMagenta on Black )
  337. cls begtype
  338. ╔═════════════════════════════════════════════════════════════════════════════╗
  339. ║    All sorts of screen attributes can be printed on the screen.          ║
  340. ║                                          ║
  341. ║   On monochrome display you see:          On color display you see:       ║
  342. ╚═════════════════════════════════════════════════════════════════════════════╝
  343.     ~Normal                   Red on Black~
  344.     ^High Intensity               High Intensity^
  345.     `Underlined                  Blue on Green`
  346.     &Blinking Normal              Blinking Light Magenta on Black&
  347.  
  348.             And many @other@ \84comb\82inat\84ions\07^!^
  349.  
  350.       ~Colors can even be ^nested^ or toggled `on` and `off`.~
  351. ╔═════════════════════════════════════════════════════════════════════════════╗
  352. ║   EBL PLUS  allows this control of screen attributes through the use of     ║
  353. ║   the COLORCHAR command.  Colors can be nested, toggled, turned off          ║
  354. ║   individually or as a group.  The alternative \\hex format can still        ║
  355. ║   be used as well.                                  ║
  356. ╚═════════════════════════════════════════════════════════════════════════════╝
  357. end
  358. colorchar
  359. colorchar '@' as color( white on blue )
  360. ansi
  361. color yellow on cyan
  362. begtype
  363. Users of ANSI.SYS can also control colors & the display.
  364.  
  365. Press any key to continue. . .
  366.  
  367. end
  368. color normal
  369. inkey
  370. IF %D = 'RAM' then RAM
  371. else BIOS
  372. cls
  373.     colorchar
  374.     color white on red
  375.     window(1,1,80,25,s)
  376.     type center("Window() function demonstration",78)
  377.  
  378.     color gray on blue
  379.  
  380.     window( 2,3,19,10 )
  381.     type "Default"
  382.     type "border"
  383.  
  384.     color red  on blue
  385.     window( 21,3,39,10,B )
  386.     type "Blank"
  387.     type "border"
  388.  
  389.     color yellow on blue
  390.     window( 41,3,59,10,S )
  391.     type "Single"
  392.     type border
  393.  
  394.     color cyan   on blue
  395.     window( 61,3,79,10,D )
  396.     type Double
  397.     type border
  398.  
  399.     color green
  400.     window( 2,12,25,24,3 )
  401.     type "3D border"
  402.  
  403.     color yellow on cyan
  404.     window( 60,12,70,14,b)
  405.     type center("Buttons",8)
  406.  
  407.     color red on black
  408.     window( 30,12,55,24,H )
  409.     color cyan
  410.     play( o5 t140 ms l8 g4 p >c <b >c p6 <e p6 d p6 b p6 >c..)
  411. BEGTYPE
  412.  
  413. Windows,
  414.   Colors,
  415.     and Sound...
  416.  
  417. makes your screens
  418.  
  419. come \8ealive\0e!!
  420.  
  421. END
  422.     inkey
  423.     color yellow on cyan
  424.     window( 15,5,65,15 )
  425.     colorchar '&' as color( Bright white on cyan )
  426.     begtype
  427.  
  428. ----- And Bouncing Bar Menus are a Snap! ------
  429.  
  430.     &     Continue with demo...        &
  431.  
  432.     &     Return to main menu...     &
  433.  
  434.     &     Exit.                &
  435. end
  436.     Select(color( Bright white on cyan ) )
  437.     if %R = 2 then goto -top
  438.     if %R = 3 then cls exit
  439.  
  440. -rd.name1
  441.     color( yellow )
  442.     colorchar
  443.     colorchar '@' as color( white on blue )
  444.     cls
  445.     if .%F <> '.' skip 3
  446.     * notice a '.' will make sure that null entries can be found
  447.     read I didn't catch your first name, what was it? %F
  448.     goto -rd.name1
  449.     type OK, your first name is %F
  450.     -rd.name2
  451.     if .%L <> '.' skip 2
  452.     read I didn't catch your last name, what was it? %L
  453.     goto -rd.name2
  454.     cls begtype
  455.  
  456. I am using your name as two strings to work with.
  457.  
  458. end
  459. type Strings contents can be manipulated . . .
  460. type CONCATENATION.. They can be combined to form %F%L
  461. type CENTERING...... Center(%F,40,'-')
  462. type "TRANSLATING.... Reverse(" reverse(%F) "), Upper(" upper(%F) "), Copies(" copies(%F,2) ")"
  463. /U | %I = %F $ 1 1
  464. %I = %I.%L $ 1 3   | /U-
  465. %H = %F #
  466. type SUBSTRINGS..... Your initials would be %I.
  467. type LENGTHS........ Your first name has %H letters.
  468. type ...and much more!
  469. begtype
  470.  
  471. @════════════════════════════════════════════════════════════════════════════@
  472.   Strings can be up to 255 characters and may be passed back and forth
  473.   to DOS.  Flexible string operations and comparisons can be done as well.
  474.   There are 10 variables for strings which may operate with DOS, and 15
  475.   which can be used even between executing BAT programs.  There are another
  476.   6 variables which have predefined (fixed) contents to give status, etc.
  477. @════════════════════════════════════════════════════════════════════════════@
  478.  
  479. Press any key to continue. . .
  480. end
  481. inkey
  482. return
  483.  
  484. *******************************************************************************
  485.  
  486. -exit    ********** Display final EXIT window ***********
  487.     locate 11 16            |* erase old bounce bar
  488.     color( yellow on red)
  489.     type " eXit                                   "
  490.  
  491.     color( white on blue )        |* setup new window w/ bounce bar
  492.     window( 18, 13, 48, 20)
  493.     type "Ready to leave EBL Plus demo!"
  494.     color Cyan on blue
  495.     type "Make selection & press ─┘"
  496.     type
  497.     colorchar . as color( yellow on green)
  498.     type ". Exit . . Help . .Return."
  499.     colorchar
  500.     %A = ""
  501.     goto -End1
  502.  
  503. *******************************************************************************
  504.  
  505. bat -on.error-
  506. bat begtype
  507.  
  508.     Unexpected error \%S%R in line \%S%L !
  509.  
  510.     This batch file was error free when it was distributed
  511.     by Seaware. An error indicates that it was most likely
  512.     modified by someone improperly. To get an updated demo
  513.     diskette send $10 to Seaware directly or call 800/634-8188.
  514.  
  515.  
  516.  
  517.                Seaware Corp.
  518.            Post Office Box 1656
  519.            Delray Beach, FL 33444
  520. end
  521. exit
  522.  
  523. ***  Built Animated ASP Logo ***
  524. *   (Caution: Use of this routine is restricted to registered ASP Members only!)
  525. *
  526. -asplogo
  527. read %M %N
  528. *
  529. *  %M = logo x corner
  530. *  %N = logo y corner
  531. *
  532. *color( white on blue )
  533. window(%M,%N,(%M+39),(%N+10),b)
  534. begtype
  535.            (tm)
  536.  
  537. ─────────────────────────────────────
  538.  
  539.  
  540.  
  541. ─────────────────────────────────────
  542. end
  543. wait until time(1)
  544. window((%M+9),(%N+1),(%M+19),(%N+5),s)
  545. begtype
  546.  
  547.     o
  548.     ║
  549. ────╨
  550. end
  551. locate (%M+22) (%N+4) | type "Association of"
  552. wait until time(1)
  553. window((%M+3),(%N+2),(%M+13),(%N+6),s)
  554. begtype
  555.  
  556.     o
  557.     ║
  558. ────╨
  559. end
  560. locate (%M+9)  (%N+2) | type "┴"
  561. locate (%M+22) (%N+5) | type "Shareware"
  562. wait until time(1)
  563. window((%M+7),(%N+4),(%M+17),(%N+8),s)
  564. begtype
  565.  
  566.     o
  567.     ║
  568. ────╨
  569. end
  570. locate (%M+13) (%N+4) | type "┴╨"
  571. locate (%M+17) (%N+5) | type "├"
  572. locate (%M+7)  (%N+6) | type "┤"
  573. locate (%M+22) (%N+6) | type "Professionals"
  574. wait until time(1)
  575. locate (%M+22) (%N+8) | type "MEMBER"
  576. wait until time(1)
  577. return
  578.