home *** CD-ROM | disk | FTP | other *** search
/ Media Share 9 / MEDIASHARE_09.ISO / batch / ben311.zip / BEN.HLP < prev    next >
Text File  |  1993-05-15  |  37KB  |  1,030 lines

  1. BEN, the Batch ENhancer, is an utility that specializes in enhancing batch
  2. files. It can incorporate colors, sounds, menus, pop-up boxes and a host of
  3. other spectacular features into any batch file that you ever write. BEN's
  4. functions are so easy to use that even a beginner batch-maker can build
  5. attractive batch files in no time at all. Experts will also appreciate
  6. BEN's powerful features, such as the directory display controls and the
  7. menuing function.
  8.  
  9. To see an example of what BEN can do for you, run the included BENDEMO.BAT.
  10. Remember to keep in mind that BENDEMO.BAT is only a batch file!
  11.  
  12. Advantages of BEN over other batch file enhancement programs:
  13.  
  14. -    Large number of powerful functions (42 in total) all contained into
  15.      one EXE file.
  16.      
  17. -    All of these functions are very easy to use.
  18.      
  19. -    Comes with BENEdit, a text editor that is tailored for BEN. With
  20.      BENEdit, you can edit all your batch files and access all the features
  21.      of BEN quickly and easily.
  22.      
  23. -    Optimized for speed.
  24.      
  25. -    Perfect for menu systems.
  26.      
  27. -    Can be used for programming any batch utilities (eg. INSTALL.BAT).
  28.      
  29. -    Compatible with DOS and Windows.
  30.      
  31. -    Compatible with the network environment. You can now use BEN to
  32.      program all the network batch files!
  33.      
  34. ───────────────────────────────────────────────────────────────────────────
  35. Format:   [d:][pathname] BEN function [params] [functions [params]...]
  36.  
  37. Entering the command "BEN" alone in DOS gives you an online help of BEN's
  38. functions. Make sure that the file BEN.HLP is in the same directory as
  39. BEN.EXE. Otherwise, the online help wouldn't work.
  40.  
  41. To access a BEN function, you must enter the command "BEN" followed by the
  42. name of the function. Some functions doesn't require any parameter. An
  43. example of this is the Beep function. You can use it by entering this
  44. command into your batch file:
  45.  
  46. BEN Beep
  47.  
  48. Other functions of BEN require one or more parameters. For example, you can
  49. clear the screen with the color blue by entering this command into your
  50. batch file:
  51.  
  52. BEN Cls Blue
  53.  
  54. BEN functions can be "stacked" one after another in a command line. For
  55. example, you can group the Beep function and the CLS function together, one
  56. after another. In this case, BEN will first create a beep, then it will
  57. clear the screen with the color blue:
  58.  
  59. BEN Beep Cls Blue
  60.  
  61. When you stack functions together, you may use the "/" separators if you
  62. want. This is not mandatory, but it helps to increase the readability of
  63. your batch file. For example:
  64.  
  65. BEN Beep / Cls Blue
  66. ───────────────────────────────────────────────────────────────────────────
  67. Ask options
  68. Beep
  69. Box x1 y1 x2 y2 foreground background borderstyle
  70. CleanUp
  71. Cls background
  72. Color foreground background
  73. Cursor On/Off/Full/Half
  74. Delay milliseconds
  75. DirDisp directory
  76. DirDispA directory filemask sortorder returnstring
  77. Echo message [message...]
  78. EGAVGA ON/OFF
  79. Extract source mask
  80. Flush
  81. GetCD
  82. GetKey
  83. GetKeyL
  84. GetKeyU
  85. GetLine
  86. GetLineL
  87. GetLineU
  88. GetVideo
  89. GrowFilledBox x1 y1 x2 y2 foreground background borderstyle
  90. List filename title
  91. Locate x y
  92. Menu title choice1 [choice2 choice3...]
  93. MenuF filename
  94. MenuLCD title choice1 [choice2 choice3...]
  95. Message line1 [line2 line3...]
  96. Pause
  97. Play playstring
  98. SavePath
  99. Scroll x1 y1 x2 y2 direction
  100. ShadFilledBox x1 y1 x2 y2 foreground background borderstyle
  101. Shell
  102. Sound frequency duration
  103. T filename
  104. TitledBox x1 y1 x2 y2 foreground background borderstyle title
  105. TransparentBox x1 y1 x2 y2 foreground background
  106. Write foreground background message
  107. WriteC foreground background message
  108. WriteV x y foreground background message
  109.  
  110. ───────────────────────────────────────────────────────────────────────────
  111. BOX FUNCTIONS
  112. ─────────────
  113.  
  114. Box x1 y1 x2 y2 foreground background borderstyle
  115.  
  116.      This function draws an empty box on the screen with an
  117.      upper-left corner of (x1,y1) and a lower-right corner of
  118.      (x2,y2). Borderstyle can be one of the following:
  119.  
  120.      0    -    no border
  121.      1    -    single line box (─)
  122.      2    -    double line box (═)
  123.      3    -    double sides, single top and bottom
  124.      4    -    single sides, double top and bottom
  125.      5    -    single left and upper, double lower and right
  126.      6    -    menu box style
  127.      7+   -    the border is drawn using the ASCII character
  128.                represented by the style value.
  129.  
  130.      The "foreground" and "background" colors can be specified
  131.      with special words that BEN recognize. These words are:
  132.      Black, Blue, Green, Cyan, Red, Magenta, Brown, LightGray,
  133.      DarkGray, LightBlue, LightGreen, LightCyan, LightRed, Light
  134.      Magenta, Yellow, and White.
  135.  
  136.      You can also specify the colors with a number if you want.
  137.      For example, instead of using the word "Black", you can use
  138.      the number 0. Instead of using the word "Blue", you can use
  139.      the number 1. And so on.
  140.  
  141.      Examples: BEN Box 1 1 80 25 White Blue 1
  142.                BEN Box 10 10 20 20 Yellow Black 3
  143.                BEN Box 4 4 8 8 9 2 65
  144.  
  145.      In the first example, BEN draws a white on blue box with a
  146.      single-line border, an upper-left corner of (1,1) and a
  147.      lower-right corner of (80,25).
  148.  
  149.      In the second example, BEN draws a yellow on black box with
  150.      double-lined borders on the sides and single-lined borders
  151.      on the top and the bottom. The box has an upper-left corner
  152.      of (10,10) and a lower-right corner of (20,20).
  153.  
  154.      In the third example, BEN draws a light-blue on green box
  155.      with a border that is drawn by the ASCII character 65 ("A").
  156.      The box has an upper-left corner of (4,4) and a lower-right
  157.      corner of (8,8).
  158.  
  159. FilledBox x1 y1 x2 y2 foreground background borderstyle
  160.  
  161.      Same as Box, but the box is filled instead of empty.
  162.  
  163.      Examples: BEN FilledBox 1 1 80 25 White Blue 1
  164.                BEN FilledBox 10 10 20 20 Yellow Black 3
  165.                BEN FilledBox 4 4 8 8 9 9 2 65
  166.  
  167. GrowFilledBox x1 y1 x2 y2 foreground background borderstyle
  168.  
  169.      Same as FilledBox, but the box "grows" out onto the screen,
  170.      creating a spectacular effect.
  171.  
  172.      Examples: BEN GrowFilledBox 1 1 80 25 White Blue 1
  173.                BEN GrowFilledBox 10 10 20 20 Yellow Black 3
  174.                BEN GrowFilledBox 4 4 8 8 9 2 65
  175.  
  176. ShadFilledBox x1 y1 x2 y2 foreground background borderstyle
  177.  
  178.      Same as FilledBox, but the box has a shadow.
  179.  
  180.      Examples: BEN ShadFilledBox 1 1 80 25 White Blue 1
  181.                BEN ShadFilledBox 10 10 20 20 Yellow Black 3
  182.                BEN ShadFilledBox 4 4 8 8 9 2 65
  183.  
  184. TitledBox x1 y1 x2 y2 foreground background borderstyle title
  185.  
  186.      Same as FilledBox, but the box has a title. Please note that
  187.      tildes (~) in the title are interpreted as spaces.
  188.  
  189.      Examples: BEN TitledBox 1 1 80 25 White Blue 1 Great~box!
  190.                BEN TitledBox 10 10 20 20 Yellow Black 3 Another!
  191.                BEN TitledBox 4 4 8 8 9 2 65 Best~box~here!
  192.  
  193. TransparentBox x1 y1 x2 y2 foreground background
  194.  
  195.      Paints the region specified by (x1,y1) - (x2,y2) with the
  196.      specified foreground and background colors. Text that are
  197.      originally on the screen are not erased; they are just
  198.      painted with a new color. Please note that the borderstyle
  199.      parameter is not required.
  200.  
  201.      Examples: BEN TransparentBox 1 1 80 25 White Blue
  202.                BEN TransparentBox 10 10 20 20 Yellow Black
  203.                BEN TransparentBox 4 4 8 8 9 2
  204.  
  205.  
  206. INPUT FUNCTIONS
  207. ───────────────
  208.  
  209. Ask options
  210.  
  211.      Waits for the user to press a key that is contained in the
  212.      'options' string. The option that the user selects is passed
  213.      to the batch file as an errorlevel. (For more details on
  214.      errorlevels, please refer to your DOS manual.)
  215.  
  216.      For instance, if the options string is ABCDE and the user
  217.      presses the letter C on the keyboard, an errorlevel of 3 is
  218.      returned (C is the third character of the string).
  219.  
  220.      Example:  @Echo Off
  221.                BEN Echo A. Format your hard drive.
  222.                BEN Echo B. Diskcopy a disk.
  223.                BEN Echo C. Run Windows.
  224.                BEN Echo D. Run DOSShell.
  225.                BEN Echo E. Play Sim City.
  226.                BEN Echo ~
  227.                BEN Echo Please make your selection.
  228.                BEN Ask ABCDE
  229.  
  230.                If Errorlevel 5 If Not Errorlevel 6 Goto SimCity
  231.                If Errorlevel 4 If Not Errorlevel 5 DOSShell
  232.                If Errorlevel 3 If Not Errorlevel 4 C:\WIN\WIN
  233.                If Errorlevel 2 If Not Errorlevel 3 DiskCopy A: A:
  234.                If Errorlevel 1 If Not Errorlevel 2 Format C:
  235.                Goto End
  236.  
  237.                :SimCity
  238.                C:
  239.                CD\SimCity
  240.                SimCity
  241.  
  242.                :End
  243.  
  244. GetKey
  245.  
  246.      Waits for the user to enter a key. This key is returned via
  247.      the environment variable %BEN% (or %BEN2%, %BEN3%, etc.
  248.      Please refer to section 2.3: "BEN and Environment Variables"
  249.      at for further details.)
  250.  
  251.      Example:  BEN GetKey
  252.                BEN Echo You've pressed the %BEN% key!
  253.  
  254. GetKeyL
  255.  
  256.      Same as GetKey, but the key is converted into lowercase
  257.      before it is returned.
  258.  
  259.      Example:  BEN GetKeyL
  260.                BEN Echo You've pressed the %BEN% key!
  261.  
  262. GetKeyU
  263.  
  264.      Same as GetKey, but the key is converted into uppercase
  265.      before it is returned.
  266.  
  267.      Example:  BEN GetKeyU
  268.                BEN Echo You've pressed the %BEN% key!
  269.  
  270. GetLine
  271.  
  272.      Waits for the user to enter a string. This string is
  273.      returned via the environment variable %BEN% (or %BEN2%,
  274.      %BEN3%, etc. Please refer to section 2.3: "BEN and
  275.      Environment Variables" for further details.)
  276.  
  277.      Example:  BEN Echo What's your name?
  278.                BEN GetLine
  279.                BEN Echo So your name is %BEN%!
  280.  
  281. GetLineL
  282.  
  283.      Same as GetLine, but the string is converted into lowercase
  284.      before it is returned.
  285.  
  286.      Example:  BEN Echo What's your name?
  287.                BEN GetLineL
  288.                BEN Echo So your name is %BEN% in lowercase!
  289.  
  290. GetLineU
  291.  
  292.      Same as GetLine, but the string is converted into uppercase
  293.      before it is returned.
  294.  
  295.      Example:  BEN Echo What's your name?
  296.                BEN GetLineU
  297.                BEN Echo So your name is %BEN% in uppercase!
  298.  
  299. Menu title choice1 [choice2 choice3...]
  300.  
  301.      Displays a menu on the screen. The choice that is selected
  302.      by the user is passed back to the batch file as an
  303.      errorlevel. For instance, if the user chooses choice #3, an
  304.      errorlevel of 3 is returned. On the other hand, if the user
  305.      opts to choose nothing, then an errorlevel of 0 is returned.
  306.  
  307.      Please note that tildes (~) are interpreted as spaces, and
  308.      no other function can be stacked after the Menu function is
  309.      used. Also, use a minus sign (-) to tell BEN to display a
  310.      blank line.
  311.  
  312.      Example:  @Echo Off
  313.                BEN Menu Please~make~a~selection:
  314.                     Format~your~hard~drive Diskcopy~a~disk
  315.                     Run~Windows Run~DOSShell Play~Simcity - Quit
  316.                If Errorlevel 6 Goto End
  317.                If Errorlevel 5 Goto SimCity
  318.                If Errorlevel 4 Goto DOSShell
  319.                If Errorlevel 3 Goto Windows
  320.                If Errorlevel 2 Goto DiskCopy
  321.                If Errorlevel 1 Goto Format
  322.                BEN Echo You didn't make a selection!
  323.                Goto End
  324.  
  325.                :Format
  326.                Format C:
  327.                Goto End
  328.  
  329.                :DiskCopy
  330.                DiskCopy A: A:
  331.                Goto End
  332.  
  333.                :Windows
  334.                C:\WIN\WIN
  335.                Goto End
  336.  
  337.                :DOSShell
  338.                DOSShell
  339.                Goto End
  340.  
  341.                :SimCity
  342.                C:
  343.                CD\SimCity
  344.                SimCity
  345.  
  346.                :End
  347.  
  348.      Note:     This example is same in functionality as the
  349.                example that illustrates the Ask function.
  350.  
  351. MenuF filename
  352.      
  353.      This function displays a menu created with MDESIGN, the menu
  354.      designer. Please refer to section 4.2 for more details.
  355.  
  356. MenuLCD title choice1 [choice2 choice3...]
  357.  
  358.      Same as Menu, except that the menu is displayed in black and
  359.      white for added clarity on LCD screens.
  360.  
  361.      Example:  BEN MenuLCD Please~make~a~selection:
  362.                Format~your~hard~drive Diskcopy~a~disk Run~Windows
  363.                Run~DOSShell Play~Simcity - Quit
  364.  
  365. Message FUNCTIONS
  366. ─────────────────
  367.  
  368. Echo message [message...]
  369.  
  370.      Works like the DOS Echo function. Everything after the word
  371.      Echo is displayed using the current writing color. Thus, no
  372.      other functions can be stacked after Echo is used.
  373.  
  374.      If you wish to display a blank line, use the command "BEN
  375.      Echo ~". If you wish to display more than one space between
  376.      two words, use the tilde (~) as a separator instead. For
  377.      example, if you want to display the words "Hello   World,
  378.      this is the computer speaking.", use the command "BEN Echo
  379.      Hello~~~World, this is the computer speaking."
  380.  
  381.      Examples: BEN Echo Hello World!
  382.                BEN Echo This is a test!
  383.                BEN Echo ~
  384.                BEN Echo Hello~~~World, this is the computer
  385.                     speaking.
  386.  
  387. List filename title
  388.  
  389.      Acts as a file browser for the file specified by "filename".
  390.      Tildes (~) in the title are interpreted as spaces.
  391.  
  392.      Examples: BEN List C:\AUTOEXEC.BAT This~is~your~AUTOEXEC!
  393.                BEN List BEN.TXT You~are~reading~BEN.TXT!
  394.  
  395. Message line1 [line2 line3...]
  396.  
  397.      Pops up a message box onto the screen. Tildes (~) are
  398.      interpreted as spaces.
  399.  
  400.      Example:  BEN Message Hello~World! This~is~a~test!
  401.  
  402.      This example will pop up a message box on the screen as
  403.      shown below:
  404.  
  405.                         ┌─[_]───────────┐
  406.                         │               │
  407.                         │Hello World!   │
  408.                         │This is a test!│
  409.                         │               │
  410.                         │     OK  ▄     │
  411.                         │    ▀▀▀▀▀▀     │
  412.                         └───────────────┘
  413.  
  414. Write foreground background message
  415.  
  416.      Writes a string onto the screen using the specified
  417.      foreground and background colors. Tildes (~) in the message
  418.      are interpreted as spaces, and a semi-colon (;) at the end
  419.      of the message tells BEN not to wrap to the next line.
  420.      
  421.      The "foreground" and "background" colors can be specified
  422.      with special words that BEN recognize. These words are:
  423.      Black, Blue, Green, Cyan, Red, Magenta, Brown, LightGray,
  424.      DarkGray, LightBlue, LightGreen, LightCyan, LightRed, Light
  425.      Magenta, Yellow, and White.
  426.      
  427.      You can also specify the colors with a number if you want.
  428.      For example, instead of using the word "Black", you can use
  429.      the number 0. Instead of using the word "Blue", you can use
  430.      the number 1. And so on.
  431.  
  432.      Examples: BEN Write LightRed Blue Hello~World!
  433.                BEN Write LightGreen Black This~is~a~test!;
  434.                BEN Write 7 1 Another~test!
  435.  
  436.      In the first example, BEN displays the string "Hello World!"
  437.      with a color of light red on blue.
  438.      
  439.      In the second example, BEN displays the string "This is a
  440.      test!" with a color of light green on black. Since there is
  441.      a semi-colon (;) at the end of the line, BEN doesn't move
  442.      the cursor to the beginning of the next line. Instead, BEN
  443.      keeps the cursor after the exclamation mark.
  444.  
  445.      In the third example, BEN displays the string "Another
  446.      test!" with a color of light gray on blue.
  447.  
  448. WriteC foreground background message
  449.  
  450.      Same as Write, but the message is centered between the two
  451.      sides of the monitor.
  452.  
  453.      Examples: BEN WriteC LightRed Blue Hello~World!
  454.                BEN WriteC LightGreen Black This~is~a~test!;
  455.                BEN WriteC 7 1 Another~test!
  456.  
  457. WriteV x y foreground background message
  458.  
  459.      Same as Write, but the message is written as a vertical
  460.      column that starts from the position (x,y).
  461.  
  462.      Examples: BEN WriteV 1 1 Yellow Blue An~important~message
  463.                BEN WriteV 40 10 LightCyan Black Hello!
  464.                BEN WriteV 80 1 7 1 Great!!!
  465.  
  466.      In the first example, BEN displays a yellow on blue vertical
  467.      column of string starting from (1,1). The string reads "An
  468.      important message".
  469.  
  470.      In the second example, BEN displays a light cyan on black
  471.      vertical column of string starting from (40,10). The string
  472.      reads "Hello!".
  473.  
  474.      In the third example, BEN displays a light gray on blue
  475.      vertical column of string starting from (80,1). The string
  476.      reads "Great!!!".
  477.  
  478.  
  479. MUSIC FUNCTIONS
  480. ───────────────
  481.  
  482. Beep
  483.  
  484.      Creates a beep sound.
  485.  
  486.      Example:   BEN Beep
  487.  
  488. Play playstring
  489.  
  490.      Plays music using the computer's speaker. The playstring is
  491.      exactly the same in format as the BASIC Play statement. Here
  492.      is a list of the music commands supported:
  493.  
  494.      ML:  legato (8/8 note length)
  495.      MN:  normal music (7/8 note length)
  496.      Ln:  length of notes (n=1-64; note length=1/n, eg. n=2 for
  497.           1/2 note)
  498.      Nn:  Note number (n=0-84; 0 is a rest)
  499.      On:  Octave (n=0-6, default 4)
  500.      Pn:  Pause (n=1-64; pause length=1/n, eg. n=4 for 1/4 note)
  501.      Tn:  Tempo (n=32-255, default 120; quarter notes per minute)
  502.      [:   Move down an octave (min 0)
  503.      ]:   Move up an octave (max 6)
  504.  
  505.      You can also use the actual letters of the notes (C, D, E,
  506.      F, G, A, and B). These correspond to "do, re, mi, fa, so,
  507.      la, ti". To play a scale, you should use "CDEFGAB]C".
  508.  
  509.      The notes may be followed by dots, by note lengths, and by
  510.      sharp or flat symbols (a '+' or '#' for a sharp, a '-' for a
  511.      flat). For example, 'D-.' is a dotted D flat. The dot means
  512.      that the note will play for half again its usual length.
  513.      Dots can be repeated.
  514.  
  515.      You can also use "<" for "[" and ">" for "]" in BEN data
  516.      files that are read by BEN's T function. Don't use these in
  517.      the command line however, because DOS will interpret them as
  518.      redirection signs. If you use them, strange errors may
  519.      occur.
  520.  
  521.      Examples: BEN Play O5CDEFGFEDCP1CC
  522.                BEN Play ]EEEC
  523.  
  524. Sound frequency duration
  525.  
  526.      Uses the computer's speaker to produce a tone with the
  527.      specified frequency for the specified duration. Frequency is
  528.      measured in hertz and duration is measured in milliseconds.
  529.  
  530.      Examples: BEN Sound 1000 1000
  531.                BEN Sound 2000 100
  532.  
  533.  
  534. SCREEN FUNCTIONS
  535. ────────────────
  536.  
  537. Cls background
  538.  
  539.      Clears the screen with the specified color.
  540.  
  541.      The colors can be specified with special words that BEN
  542.      recognize. These words are: Black, Blue, Green, Cyan, Red,
  543.      Magenta, Brown, LightGray, DarkGray, LightBlue, LightGreen,
  544.      LightCyan, LightRed, Light Magenta, Yellow, and White.
  545.  
  546.      You can also specify the color with a number if you want.
  547.      For example, instead of using the word "Black", you can use
  548.      the number 0. Instead of using the word "Blue", you can use
  549.      the number 1. And so on.
  550.  
  551.      Examples: BEN Cls Blue
  552.                BEN Cls Green
  553.  
  554. Color foreground background
  555.  
  556.      Changes the current writing color. ANSI.SYS must be loaded
  557.      for this function to operate.
  558.  
  559.      The "foreground" and "background" colors can be specified
  560.      with special words that BEN recognize. These words are:
  561.      Black, Blue, Green, Cyan, Red, Magenta, Brown, LightGray,
  562.      DarkGray, LightBlue, LightGreen, LightCyan, LightRed, Light
  563.      Magenta, Yellow, and White.
  564.  
  565.      You can also specify the colors with a number if you want.
  566.      For example, instead of using the word "Black", you can use
  567.      the number 0. Instead of using the word "Blue", you can use
  568.      the number 1. And so on.
  569.  
  570.      Examples: BEN Color Yellow Blue
  571.                BEN Color White Red
  572.                BEN Color 7 1
  573.  
  574. Cursor On/Off/Full/Half
  575.  
  576.      Changes the cursor shape. Use On for a normal cursor (_),
  577.      Off for no cursor ( ), Full for a block cursor (█) and Half
  578.      for a half-block cursor (▄).
  579.  
  580.      Examples: BEN Cursor Off
  581.                BEN Cursor Full
  582.  
  583. EGAVGA On/Off
  584.  
  585.      Switches the EGA 43 / VGA 50 line mode on or off. If the EGA
  586.      43 / VGA 50 line mode is switched on successfully, an
  587.      errorlevel of 2 is passed back to the batch file. Otherwise,
  588.      an errorlevel of 1 is returned.
  589.  
  590.      Example:  @Echo Off
  591.                BEN EGAVGA On
  592.                If Errorlevel 2 Goto SUCCESS
  593.                BEN Echo Sorry. Your computer cannot display in
  594.                BEN Echo the EGA 43 or the VGA 50 line mode.
  595.                Goto End
  596.  
  597.                :SUCCESS
  598.                BEN Cls Blue Color White Blue Locate 30 30
  599.                BEN Echo See how big your screen is!
  600.                BEN Locate 30 33
  601.                Pause
  602.                BEN EGAVGA Off
  603.  
  604.                :End
  605.                BEN CleanUp
  606.  
  607. GetVideo
  608.  
  609.      Finds out what kind of video system is installed and returns
  610.      the result via %BEN% (or %BEN2%, %BEN3%, etc. Please refer
  611.      to section 2.3: "BEN and Environment Variables" for further
  612.      details.)
  613.  
  614.      The possible values that can be returned are as follows:
  615.  
  616.      Mono:     The computer has a monochrome system.
  617.      CGA:      The computer has a CGA system.
  618.      EGA:      The computer has an EGA system.
  619.      MCGA:     The computer has a MCGA system.
  620.      VGA:      The computer has a VGA system.
  621.  
  622.      Example:  @Echo Off
  623.                BEN GetVideo
  624.                IF "%BEN%"=="Mono" GOLF /Mono
  625.                IF "%BEN%"=="CGA" GOLF /CGA
  626.                IF "%BEN%"=="EGA" GOLF /EGA
  627.                IF "%BEN%"=="MCGA" GOLF /MCGA
  628.                IF "%BEN%"=="VGA" GOLF /VGA
  629.  
  630.      This example shows a batch file that passes different
  631.      parameters to the GOLF program (a game?) depending on what
  632.      video system the computer has.
  633.  
  634. Locate x y
  635.  
  636.      Moves the screen cursor to the position (x,y).
  637.  
  638.      Examples: BEN Locate 1 1
  639.                BEN Locate 10 15
  640.  
  641. Scroll x1 y1 x2 y2 direction
  642.  
  643.      Scrolls the text enclosed in the (x1,y1)-(x2,y2) box.
  644.      'Direction' can be one of the following: UP, DOWN, LEFT,
  645.      RIGHT.
  646.  
  647.      Examples: BEN Scroll 1 1 80 25 UP
  648.                BEN Scroll 10 10 20 20 LEFT
  649.  
  650.  
  651. MISCELLANEOUS FUNCTIONS
  652. ───────────────────────
  653.  
  654. CleanUp
  655.  
  656.      This function should be called at the end of batch files. It
  657.      does four things:
  658.      1.   Changes the writing color to normal DOS color (same as
  659.           calling BEN Color LightGray Black).
  660.      2.   Changes the cursor to a normal shape (same as calling
  661.           BEN Cursor On).
  662.      3.   Erases all the environment variables that have been
  663.           created by BEN (IE. %BEN%, %BEN2%, %BEN3%, etc.)
  664.      4.   Restores the PATH if the SavePath function had been
  665.           called previously. (Please refer to the discussion on
  666.           the SavePath function.)
  667.  
  668.      Example:  BEN CleanUp
  669.  
  670. Delay milliseconds
  671.  
  672.      Pauses the computer for the specified number of
  673.      milliseconds. (1000 milliseconds = 1 second)
  674.  
  675.      Examples: BEN Delay 1000
  676.                BEN Delay 5000
  677.  
  678. DirDisp directory
  679.  
  680.      Displays a file selection box and allows the user to select
  681.      a file. The name of the selected file is stored into %BEN%
  682.      (or %BEN2%, %BEN3%, etc. Please refer to section 2.3: "BEN
  683.      and Environment Variables" for further details.)
  684.  
  685.      If the user presses ESC and opts not to choose any file,
  686.      then %BEN% is set to contain nothing.
  687.  
  688.      Example:  BEN DirDisp C:\
  689.                IF "%BEN%"=="" Goto Chose_Nothing
  690.                BEN Echo You've chosen %BEN%!
  691.                Goto End
  692.                :Chose_Nothing
  693.                BEN Echo You didn't choose any file!
  694.                :End
  695.  
  696. DirDispA directory filemask sortorder returnstring
  697.  
  698.      This is the advanced version of DirDisp. In addition to the
  699.      starting directory, you can specify the file mask and the
  700.      sorting order.
  701.      
  702.      'Filemask' specifies the types of file you want to display.
  703.      For example, if you want to display only EXE files, you can
  704.      use a filemask of "*.EXE". If you want to display both EXE
  705.      and COM files, you can use a filemask of "*.EXE~*.COM"
  706.      [different types of files are separated with tildes (~).]
  707.      
  708.      'Sortorder' specifies the order which DirDispA uses to
  709.      display the files. It can be one of the following:
  710.  
  711.      NAME      -    Files sorted on names in ascending order.
  712.      EXTENSION -    Files sorted on extensions in ascending
  713.                     order.
  714.      TIME      -    Files sorted on time from the earliest to the
  715.                     latest.
  716.      SIZE      -    Files sorted on size from the smallest to the
  717.                     largest.
  718.      X         -    Files are unsorted.
  719.  
  720.      You can also specify only the first letter of the sortorder
  721.      you want. For example, instead of "BEN DirDispA C:\ *.*
  722.      NAME", you can use "BEN DirDispA C:\ *.* N". This is not
  723.      suggested, however, because it decreases the legibility of
  724.      your batch file.
  725.  
  726.      Example:  BEN DirDispA C:\ *.BAT~*.SYS~*.EXE EXTENSION
  727.                BEN Echo You've picked the file %BEN%!
  728.  
  729. Extract source mask
  730.  
  731.      This is a function that extracts a certain part of a fully
  732.      qualified filename (eg. the result from DirDisp or GetCD)
  733.      and stores it into %BEN% (or %BEN2%, %BEN3%, etc. Please
  734.      refer to section 2.3: "BEN and Environment Variables" for
  735.      further details.)
  736.  
  737.      'Source' specifies the source string from which you want to
  738.      extract information. Usually, you should place an
  739.      environment variable here.
  740.  
  741.      'Mask' specifies the part of the selected filename you want
  742.      BEN to return to you. It can contain one or more letters
  743.      which define what BEN should put into %BEN%:
  744.  
  745.      D    -    Returns only the drive part of the source (eg. C:)
  746.      P    -    Returns only the path part of the source without
  747.                the trailing backslash (eg. \TELECOM)
  748.      \    -    Adds a trailing backslash to the path
  749.      N    -    Returns only the name part of the source
  750.                (eg. AUTOEXEC)
  751.      .    -    Adds a dot to the name
  752.      E    -    Returns only the extension part of the source (eg.
  753.                BAT)
  754.      
  755.      Example:  BEN DirDisp C:\TELECOM
  756.                SET SELECT=%BEN%
  757.                BEN Extract %SELECT% D
  758.                BEN Echo You've selected a file that is located in
  759.                     drive %BEN%
  760.                BEN Extract %SELECT% P
  761.                BEN Echo This file has a path (without trailing
  762.                     backslash) of %BEN%
  763.                BEN Extract %SELECT% P\
  764.                BEN Echo This file has a path (with trailing
  765.                     backslash) of %BEN%
  766.                BEN Extract %SELECT% N
  767.                BEN Echo This file's name is %BEN%
  768.                BEN Extract %SELECT% E
  769.                BEN Echo And its extension is %BEN%
  770.                BEN Extract %SELECT% N.E
  771.                BEN Echo Its filename (name+extension) is %BEN%
  772.                BEN Extract %SELECT% P\N.E
  773.                BEN Echo Its path, name and extension is %BEN%
  774.                BEN Extract %SELECT% DP\N.E
  775.                BEN Echo This file's full name is %BEN%!
  776.                BEN Echo ~
  777.                BEN GetCD
  778.                BEN Extract %BEN% DRIVE
  779.                BEN Echo You're currently in %BEN% drive.
  780.      
  781. Flush
  782.  
  783.      Clears the keyboard buffer.
  784.  
  785.      Example:  BEN Flush
  786.  
  787. GetCD
  788.  
  789.      Finds out what the current directory is and stores it into
  790.      %BEN% (or %BEN2%, %BEN3%, etc. Please refer to section 2.3:
  791.      "BEN and Environment Variables" for further details.)
  792.  
  793.      Example:  BEN GetCD
  794.                BEN Echo Hey man, you're in the %BEN% directory!
  795.                
  796. Pause
  797.  
  798.      Pauses the computer until the user presses a key.
  799.  
  800.      Example:   BEN Pause
  801.  
  802. SavePath
  803.  
  804.      Saves the PATH environment variable into a file called
  805.      SavePath.DAT (this file is stored in the current directory)
  806.      and erases the PATH environment variable. Using this
  807.      function can free up environment space so that BEN functions
  808.      that make use of the environment (eg. GetLine) can function
  809.      better. Remember to use the CleanUp function to restore the
  810.      PATH upon the completion of the batch file.
  811.  
  812.      Caution:  Make sure that you don't change directory after
  813.                using SavePath. If you do, you must change back to
  814.                the directory where SavePath stores SavePath.DAT
  815.                before you run CleanUp.
  816.  
  817.      Example:  @Echo Off
  818.                BEN SavePath
  819.                BEN Echo Your PATH has been saved!
  820.                BEN CleanUp
  821.                BEN Echo Your PATH is restored!
  822.  
  823. Shell
  824.  
  825.      "Jumps to DOS". After this function is used, the user can
  826.      work in DOS as long as he/she want. He/she can let the batch
  827.      file regain control by typing EXIT.
  828.  
  829.      Example:  BEN Shell
  830.  
  831. T filename
  832.  
  833.      Runs all the instructions in the data file. This lets BEN
  834.      perform its jobs at a quicker speed.
  835.  
  836.      The data file is just a normal text file (ASCII format). It
  837.      can be created with any text editor, such as BENEDIT or the
  838.      EDLIN or the EDIT programs included with DOS. The format of
  839.      the text file is as follows:
  840.  
  841.      FUNCTIONS
  842.      FUNCTIONS
  843.      FUNCTIONS
  844.      .
  845.      .
  846.      .
  847.      FUNCTIONS
  848.      <End of File>
  849.  
  850.      The FUNCTIONS are exactly the same functions as those that
  851.      are ran from the command line. For example:
  852.  
  853.      BEN T DATA.DAT
  854.      
  855.      where DATA.DAT contains:
  856.      
  857.      Box 1 1 80 25 Yellow Green 3
  858.      Pause
  859.      Cursor Off
  860.      Cls Blue
  861.      <End of File>
  862.      
  863.      is exactly the same as doing this:
  864.      
  865.      BEN Box 1 1 80 25 Yellow Green 3
  866.      BEN Pause
  867.      BEN Cursor Off
  868.      BEN Cls Blue
  869.      ;This is a comment line.
  870.      ;Comment lines start with a ';'.
  871.      
  872.      Usually, you should only use the T function when you have a
  873.      large quantity of functions that you wish to be processed by
  874.      BEN.
  875.      
  876.      Examples: BEN T MYFILE.DAT
  877.                BEN T C:\BATCH\INSTRUCT
  878.  
  879. ───────────────────────────────────────────────────────────────────────────
  880. BEN and environment variables
  881. ─────────────────────────────
  882. Several of BEN's functions (IE. GetKey, GetKeyL, GetKeyU, GetLine,
  883. GetLineL, GetLineU, DirDisp, DirDispA, Extract, GetCD and GetVideo) return
  884. their results using environment variables. After you use any one of these
  885. functions, you can access the data that BEN returns by calling the variable
  886. %BEN%. Just put %BEN% in your batch file where you want the data to appear.
  887. For example, if you want to get the user's name and re-display it, you can
  888. do the following:
  889.  
  890. BEN Write White Black Please~enter~your~name:~; GetLine
  891. BEN Write White Black Your~name~is~%BEN%!
  892.  
  893. If you stack several functions that return data via environment variables,
  894. the first result would be stored into %BEN%, the second result into %BEN2%,
  895. the third into %BEN3%, and so on. For example, if you want to ask the user
  896. to enter two favorite colors and re-display them, you can do the following:
  897.  
  898. BEN Write White Black Enter~your~two~favorite~colors:
  899. BEN GetLine GetLine
  900. BEN Write White Black So~they~are:~%BEN%~and~%BEN2%!
  901.  
  902. Note:     At the end of your batch file, you should make a call to BEN's
  903.           CleanUp function to erase all the variables that BEN have created
  904.           (IE %BEN%, %BEN2%, %BEN3%, etc.)
  905.  
  906. ───────────────────────────────────────────────────────────────────────────
  907. Shareware Registration
  908. ──────────────────────
  909. BEN is NOT free software. BEN is NOT public domain software. BEN is
  910. shareware: you are expected to pay a registration fee to the author of this
  911. program if you find it useful. You are allowed to use BEN for free within a
  912. trial period of 60 days. After 60 days, if you continue to use BEN, you
  913. must register.
  914.  
  915. There are three editions of BEN available for registration:
  916.  
  917. A>   Personal Edition - $39
  918.  
  919.      With registration, you get the following:
  920.      -    Complete BEN package on a disk:
  921.  
  922.           -    BEN.EXE with your specified registration name encoded into
  923.                the code.
  924.                
  925.           -    BENMOUSE.EXE (a bonus version of BEN that has the ability to
  926.                make use of mouses) with your specified registration name
  927.                encoded into the code.
  928.                
  929.           -    BENEDIT.EXE with your specified registration name encoded
  930.                into the code.
  931.                
  932.           -    MDESIGN.EXE with your specified registration name encoded
  933.                into the code.
  934.                
  935.      -    All other BEN-related files.
  936.           
  937.      -    Next version of the complete BEN package on a disk free of
  938.           charge.
  939.           
  940.      -    One printed manual that covers all aspects of BEN.
  941.           
  942.      -    Free technical support.
  943.           
  944. B>   Programmer's Edition - $99
  945.  
  946.      With registration, you get the following:
  947.      -    Complete BEN package on a disk:
  948.  
  949.           -    BEN.EXE with your specified registration name encoded into
  950.                the code.
  951.                
  952.           -    BENMOUSE.EXE (a bonus version of BEN that has the ability to
  953.                make use of mouses) with your specified registration name
  954.                encoded into the code.
  955.                
  956.           -    BENEDIT.EXE with your specified registration name encoded
  957.                into the code.
  958.                
  959.           -    MDESIGN.EXE with your specified registration name encoded
  960.                into the code.
  961.                
  962.      -    All other BEN-related files.
  963.           
  964.      -    Next version of the complete BEN package on a disk free of
  965.           charge.
  966.           
  967.      -    One printed manual that covers all aspects of BEN.
  968.           
  969.      -    A distribution license. With this license, you are permitted to
  970.           use BEN to create batch utilities that you can distribute,
  971.           royalty-free.
  972.           
  973.      -    Free technical support.
  974.           
  975. C>   Business Edition - $199
  976.  
  977.      With registration, you get the following:
  978.      -    Complete BEN package on a disk:
  979.  
  980.           -    BEN.EXE with your specified registration name encoded into
  981.                the code.
  982.                
  983.           -    BENMOUSE.EXE (a bonus version of BEN that has the ability to
  984.                make use of mouses) with your specified registration name
  985.                encoded into the code.
  986.                
  987.           -    BENEDIT.EXE with your specified registration name encoded
  988.                into the code.
  989.                
  990.           -    MDESIGN.EXE with your specified registration name encoded
  991.                into the code.
  992.                
  993.      -    All other BEN-related files.
  994.           
  995.      -    All future versions of the complete BEN package on a disk free of
  996.           charge.
  997.           
  998.      -    Five sets of printed manuals that covers all aspects of BEN.
  999.           
  1000.      -    A site license for unlimited number of users on a LAN.
  1001.           
  1002.      -    A distribution license. With this license, you are permitted to
  1003.           use BEN to create batch utilities that you can distribute,
  1004.           royalty-free.
  1005.           
  1006.      -    Free technical support.
  1007.           
  1008. To order, please send $39, $99 or $199 (depending on which edition you
  1009. want) + $5 Postage/Handling to the following address:
  1010.  
  1011.                             Simon Lee
  1012.                         7905 Bayview Ave.
  1013.                             Unit 1019
  1014.                        Thornhill  Ontario
  1015.                              Canada
  1016.                              L3T 7N3
  1017.  
  1018. Notes:
  1019.  
  1020. -    Do specify the registration name (eg. Mr. Bill Smith, ABC Company).
  1021. -    Do specify the size of the disk you want (IE. 5.25" or 3.5")
  1022. -    Pay in cash or cheque.
  1023. -    Make all cheques payable to Simon Lee.
  1024. -    Pay in Canadian currency if ordered from Canada. Pay in US currency if
  1025.      ordered from US or other countries.
  1026.  
  1027. *    You can simplify the registration process by selecting the "Register"
  1028.      option under the system menu in BENEdit.
  1029.  
  1030.