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

  1. bat * Loading HELP and DOCUMENTATION part 2
  2.  
  3. *           Written by F.Canova 10/5/83 through 01/15/92
  4. *   (c) Copyright 1983 to 1992 by Seaware Corp. all rights reserved.
  5. *    This batch file REQUIRES EBL PLUS for proper execution!
  6.  
  7.          **** NOTE! NOTE! NOTE! NOTE! ****
  8.  RAM    |* <-----Change 'RAM' to 'BIOS' if PC isn't 100% IBM Compatible!
  9.  
  10.  if %G = .goto. then %G = | goto -%F
  11.  beep type Error! Begin by using BATDOC first!
  12.  type This file is an overlay to BATDOC.
  13.  exit
  14.  
  15. -opt0     %F = opt0     | skip 3
  16. -line0     %F = line0    | skip 2
  17. -line599  %F = line599 | skip 1
  18. -line1404 %F = line1404
  19.     %G = .goto.
  20.     color 8f |type Loading part 1 ...
  21.     leave
  22.     batdoc
  23.  
  24. -header * Routine prints general purpose header for help text
  25.     stack.purge            |*  remove any pre-typed keystrokes.
  26.     %n = %i $ 1 ( %i # - 2 ) & . & ( %i $ ( %i # - 1 ) 2 ) |* extract section # from page #
  27.     color( white on black )
  28.     cls
  29.     color( white on cyan  )
  30.     window( 1, 1, 79, 3, Combo)
  31.     begtype
  32.  \%H                     Page \%n
  33.  
  34. \07    Press:  PGDN for next page,   PGUP for prev page,  HOME for main menu.
  35. end
  36.     color( white on black)
  37.     colorchar ~ as color(yellow on black)
  38.     window( 1, 5, 79, 25, Combo)
  39.     return
  40.  
  41. -scroll * Routine accepts key for scrolling help text
  42.     %e = 0
  43.     inkey %k
  44.     if %k = KEY("Ctrl-C") then goto -opt0
  45.     if %k = KEY(Esc)  %i = 0      | goto -line0
  46.     if %k = KEY(Home) %i = 0      | goto -line0
  47.     if %k = KEY(Pgup) %i = %i - 1 | cls | %F = line%i | goto -%F
  48.     if %k = KEY(Pgdn) %i = %i + 1 | cls | %F = line%i | goto -%F
  49.     goto -scroll |* ignore any other key.
  50.  
  51.     * ROUTINE TO HAVE USER GIVE A COMMAND A TRY !!
  52.     * %A = string which must match
  53. -tryit
  54.     begtype
  55.  
  56.   Enter your guess!  ;
  57. end
  58. -tryit.loop
  59.     if .%a = . goto -tryit.solved.it |* end of string ?
  60.     %b = %a $ 1 1        |* get 1st letter
  61.     %a = %a $ 2        |* remove it from string
  62. -tryit.retry
  63.     inkey %k          |* get a key.
  64.     if %k = KEY(" ") type %b; | goto -tryit.loop
  65.     if %k = KEY(ESC) type %b%a| goto -tryit.give.up
  66.     if %k = %b type %k;      | goto -tryit.loop
  67.     beep goto -tryit.retry
  68.  
  69. -tryit.solved.it
  70.     begtype
  71.  
  72.  
  73. EXCELLENT !! - that's exactly it!
  74.  
  75. end
  76.     read Press the ─┘ key to continue to next section.....
  77.     return
  78.  
  79. -tryit.give.up
  80.     begtype
  81.  
  82. That's the answer you needed! (You can "peek" at part of
  83. the answer next time by pressing the space bar if you'd like.)
  84.  
  85. end
  86.     read Press the ─┘ key to continue to next section.....
  87.     return
  88.  
  89. -opt6
  90. -line503 %i = 600
  91. -line600 %H = "How to print" | call -header| begtype
  92.   The simplest thing to for Extended Batch Language to do is to print text
  93. on the display.  This is done by either of two commands, TYPE and BEGTYPE.
  94.  
  95.   The TYPE command can be used for something as simple as saying hello!
  96. For example, just put this in a batch file...
  97.  
  98.     BAT * Hello example...
  99.     TYPE "HELLO THERE"
  100.  
  101.   This is all that is needed.  This command can be typed directly from DOS
  102. (this is called immediate mode) or be entered into a file such as
  103. "TRIAL.BAT" (this is called direct execution mode).  To execute it as a BAT
  104. program with the file, just type the file's name "TRIAL" from DOS and you
  105. will see the results of the program "HELLO THERE" coming from BAT.
  106.  
  107. Note that all EBL batch programs start with the word "BAT" and an optional
  108. comment. This is always needed. For simplicity, we won't show it much in
  109. the upcoming examples, but using it is necessary to tell DOS that future
  110. commands are understood by EBL-Plus.
  111. end
  112.     goto -scroll
  113. -line601 call -header | begtype
  114.  
  115.   You can also put DOS variables into this command to display their
  116. contents.  For example, if the "TRIAL.BAT" file contained the line:
  117.  
  118.     TYPE "HELLO THERE" %1 %2
  119.  
  120.   Then when we start the BAT program from DOS, we might enter:
  121.  
  122.     TRIAL COMPUTER USER
  123.  
  124.   DOS will automatically store the words after the program name into its
  125. variables.  Therefore, in the TYPE command, we will see contents of these
  126. variables on the screen.  The resulting message would be:
  127.  
  128.     HELLO THERE COMPUTER USER
  129. end
  130.     goto -scroll
  131. -line602 call -header | begtype
  132.  
  133.   There is a second method of putting text onto the display.  This is with
  134. the BEGTYPE command.  Although it will not display the contents of
  135. variables, it is very useful for displaying large blocks of text, such as
  136. menus.    For example, if the "TRIAL.BAT" file contains:
  137.  
  138.     BAT BEGTYPE
  139.     This is a large block of text. It is useful for menus. Note
  140.     that Upper/Lower case characters are displayed intact here.
  141.     The block is always ended with "END" in the first column
  142.     after the text finishes.
  143.     END
  144.  
  145.   When executed, the "TRIAL.BAT" program will display:
  146.  
  147.     This is a large block of text. It is useful for menus. Note
  148.     that Upper/Lower case characters are displayed intact here.
  149.     The block is always ended with "END" in the first column
  150.     after the text finishes.
  151. end
  152.     goto -scroll
  153. -line603 call -header | begtype
  154.  
  155. The easiest way to add color to menus is to first use the COLORCHAR command
  156. to make a character represent a color change. Then, every time that character
  157. is used within the BEGTYPE block, future text will be highlighted with
  158. the new color. A space will be added where each color change occurs.
  159. This technique is useful for both BEGTYPE and TYPE commands.
  160.  
  161.     BAT * BEGTYPE color sample ...
  162.     ColorChar @ as Color(Yellow)
  163.     BEGTYPE
  164.     @This@is highlighted
  165.     End
  166.     Type "So is@this!@"
  167.  
  168. and after running the EBL program we see...
  169.  
  170.      ~This~is highlighted
  171.      So is~this!~
  172. end
  173.     goto -scroll
  174. -line699 %i = 604
  175. -line604 call -header | begtype
  176.  
  177.   There is an additional advantage to using BEGTYPE command.  This command
  178. can also highlight text to the user.  This is done by using the form:
  179. [\\hex] within the text block.
  180.  
  181.   For example if the text block contained \\0F within the text, the result
  182. would be ~ High Intensity Text !  ~.
  183.  
  184.   By choosing different values, the screen attributes can be controlled to
  185. create inverted video, blinking, underlined, and very colorful text.
  186.  
  187.   You can also display the contents of variables by using [\\%Var.name] in
  188. the text block. For instance, if the variable %0 is to be printed, use \\%0
  189. within the text after the BEGTYPE command.
  190.  
  191.   An additional command CLS can be used to clear the display before
  192. printing data.    For instance, the combination "BAT CLS BEGTYPE" is quite
  193. useful for printing menus and text such as this screen.
  194. end
  195.     goto -scroll
  196. -line604
  197.     begtype
  198.  
  199.     ~NOW IT'S YOUR TURN !!!~
  200.  
  201.  
  202. If the ~%4~ variable contains the word ~DAY~, what is the command to display
  203. the words "~FUN DAY~" on the display?
  204.  
  205. end
  206.      %A = "TYPE FUN %4" | Call -tryit
  207. -opt7
  208. -line605  %i = 700
  209. -line700 %H = "Reading things from user" | call -header | begtype
  210.   In order to get input from the user, there are two available commands,
  211. READ and INKEY.
  212.  
  213.   When the command word READ is seen in the batch file, an input line is
  214. accepted from the user.  All function keys are assigned to the normal DOS
  215. edit functions.  When ENTER is pressed, the input line is assigned to DOS
  216. variables.
  217.  
  218.   Each word will be assigned in order to the variables indicated after the
  219. READ command.  When there are no more variables after the READ command to
  220. assign, the remainder of the response is thrown away.  If there are more
  221. variables to be assigned after the READ command than there are words from
  222. the user, these variables will be cleared out to a empty state.  For
  223. example:
  224.  
  225.     READ Please enter your name ==> %1 %2
  226.  
  227.   This would prompt the user and wait for him to enter two words.  These
  228. words will be saved in the %1 and %2 variables.
  229. end
  230.      goto -scroll
  231. -line701 call -header | begtype
  232.  
  233.   Note that there does not have to be any variables indicated after the
  234. command READ.  In this case, EBL would wait for the enter key, throw away
  235. any response, then continue to process the next batch file command.
  236.  
  237. end
  238.     goto -scroll
  239. -line702 call -header | begtype
  240.  
  241.   In the event that you wish to get a single keystroke from the user, the
  242. INKEY command should be used.
  243.  
  244.   This command will wait for the user to enter a single key on the keyboard
  245. and return its value in the optional variable.    This key can be not only
  246. letters, but all function keys, control keys, etc.  For example:
  247.  
  248.     INKEY Press any key to continue... %0
  249.  
  250.   When the user presses a single key, that key is saved into the variable %0.
  251.  
  252.   If the key that is pressed is in the range of "!" to "z" (decimal 33 to
  253. 122) then the key saved to the optional variable. If you wish this key to be
  254. echoed to the display, you must specifically use the TYPE command.
  255.  
  256. end
  257.      goto -scroll
  258. -line799 %i = 703
  259. -line703 call -header | begtype
  260.  
  261.   If the key is not in the above range, then the key will be converted to
  262. the form "KEYxxx" where xxx is the hex value of the key.  Extended key
  263. codes will be in the range KEY100 to KEY1FF and nonextended key codes will
  264. be in the range KEY000 to KEY0FF.  Refer to Appendix G of the Basic manual
  265. for a complete description of the various assignments of key codes.
  266.  
  267.   The character does not have to be assigned to a variable.  If the
  268. variable name is not present following the command INKEY, the system will
  269. wait for any key to be pressed from the user, and then continue processing.
  270.  
  271. end
  272.     goto -scroll
  273. -line704
  274.     begtype
  275.  
  276.     ~NOW IT'S YOUR TURN !!!~
  277.  
  278.  
  279.   We wish to create a menu with several options.  At a "~=>~" prompt,
  280. the user must enter a~single letter~to select his option.  What is
  281. the command needed to request a single keystroke into the ~%4~
  282. variable for option selection using the prompt above?
  283.  
  284. end
  285.      %A = "INKEY => %4" | call -tryit
  286. -opt8     %i = 800
  287. -line800 %H = "Program Control" | call -header| begtype
  288.   There are several ways of controlling the order of execution of a program
  289. written with Extended Batch Language.  GOTO, CALL, RETURN, and IF are all
  290. commands that do this.    The simplest is the GOTO command:
  291.  
  292.     GOTO -LABEL
  293.  
  294.   If this line is put into a ".BAT" file, then it will stop execution at
  295. this line and resume at the line within the file which contains:
  296.  
  297.     -LABEL
  298.  
  299.   This is a unconditional branch.  If the label is not present within the
  300. file, and error will result.  Note the minus (-) sign before the label
  301. name. ~Labels must be preceded with a minus sign.~ This is done so
  302. that EBL can tell the difference between a label and a command within the
  303. language.
  304. end
  305.     goto -scroll
  306. -line801 call -header | begtype
  307.  
  308.    A CALL command is similar to a GOTO command.  The primary difference is
  309. that the line where the CALL command was is saved away.  Then a branch to a
  310. label is done, just like the GOTO command.  Note that the CALL command can
  311. be nested up to 31 levels.  When a RETURN command is found, the last line
  312. that was saved is now restored.  Execution resumes at the line following
  313. the original CALL command.
  314.  
  315. end
  316.     goto -scroll
  317. -line802 call -header | begtype
  318. For example, if a program contains:
  319.  
  320.         TYPE One
  321.        ~CALL -LABEL~
  322.        ~CALL -LABEL~
  323.         TYPE Four
  324.         EXIT
  325.     -LABEL
  326.         TYPE Two
  327.         TYPE Three
  328.        ~RETURN~
  329.  
  330.   You will see on the display:
  331.     One
  332.     Two
  333.     Three
  334.     Two
  335.     Three
  336.     Four
  337. end
  338.     goto -scroll
  339. -line803 call -header | begtype
  340.   The final way to control the flow of an Extended Batch Language program
  341. is to use an IF command.  The general form of this command is:
  342.  
  343.     IF _word_   _condition_   _word_   _operation_______
  344.  
  345.  
  346.   Each word can be a fixed string of letters, or a variable, or a
  347. combination of each.
  348.  
  349.   The conditions can be:
  350.  
  351.     <    less than
  352.     >    greater than
  353.     <>    not equal to
  354.     =    equal to (case insensitive)
  355.     ==    exactly equal to (case sensitive)
  356.  
  357.   The operation can be any of the Extended Batch Language commands.
  358. end
  359.      goto -scroll
  360. -line899 %i = 804
  361. -line804 call -header | begtype
  362.   For example, all of the following IF statements will compare correctly
  363. and execute their corresponding TYPE command.  The first two statements
  364. will initialize variables used in the IF commands.
  365.  
  366.     %1 = ABC
  367.     %2 =
  368.  
  369.     IF ABC = %1  TYPE The variable contains ABC.
  370.     IF %1 = abc  TYPE This also matches.
  371.     IF 0 <> 00   TYPE These are different lengths.
  372.     IF 0 < 00    TYPE 0 has a smaller length.
  373.     IF 456 > 123 TYPE Numerically, 456 is bigger.
  374.     IF 456 < %1  TYPE ASCII value of 456 is smaller.
  375.     IF AABCD = A%1D TYPE Token substitutions are made.
  376.     IF %2 <> %1  TYPE Variables are different lengths.
  377.     IF .%2 = .   TYPE This matches if var is empty.
  378.     IF BOX = BOX IF DOG <> CAT TYPE Did multi-if compare.
  379.     IF 1 + 2 = 3 TYPE Arithmetic results match.
  380. end
  381.     goto -scroll
  382. -line805
  383.     begtype
  384.  
  385.        ~NOW IT'S YOUR TURN !!!~
  386.  
  387.  
  388.   We wish to make a series of tests on a menu option that a user entered.
  389. It is saved in the variable~%4~.  What command is needed to test for
  390. the letter "~A~"?
  391.  
  392. end
  393.      %A = "IF %4 = A" | call -tryit
  394. -opt9     %i = 900
  395. -line900 %H = "KEYBOARD STACK" | call -header| begtype
  396.   There is a method within the EBL language for answering questions from
  397. programs without operator intervention.  This is done by a "keyboard
  398. stack".  By entering data into the stack, you will essentially be entering
  399. data through your keyboard when any program requests it.  In this way, a
  400. batch file can now answer questions programs may have by 'typing' them for
  401. the user.
  402.  
  403.   The keyboard stack operates in a "first-in first-out" basis.  That is,
  404. the first line of text put into the stack will be the first seen by the
  405. program when it reads the keyboard.  The second line entered will be the
  406. second seen by the program, and so on.    As long as there is text remaining
  407. on the stack, ALL requests for data from the keyboard will actually come
  408. from the stack.  Once the stack has been emptied by the program, data will
  409. then come from the keyboard as usual.
  410.  
  411.   There are two commands which store data into the stack, STACK and
  412. BEGSTACK. Here's some more about them.....
  413. end
  414.      goto -scroll
  415. -line901 call -header | begtype
  416.   The STACK command is very much like the previously mentioned TYPE
  417. command.  Instead of displaying to the screen, it will "push" data into the
  418. keyboard stack area.  When any program is ready to accept information from
  419. the keyboard, the parameters after the STACK command will be used as input.
  420. For example:
  421.  
  422.     * This program will issue remarks to DOS.
  423.     %1 = HELLO
  424.     STACK REM THIS IS A REMARK FOR DOS
  425.     STACK REM VARIABLE %%1 = %1
  426.  
  427. When executed, the following will appear on the screen:
  428.  
  429.     A>REM THIS IS A REMARK FOR DOS
  430.  
  431.     A>REM VARIABLE %1 = HELLO
  432. end
  433.      goto -scroll
  434. -line902 call -header | begtype
  435.   The second command used to stack data is BEGSTACK.  This command is
  436. equivalent to BEGTYPE previously described.  It is useful for dumping large
  437. amounts of data to the stack area.  Although no parameter substitution is
  438. performed, there are several advantages to its use.
  439.  
  440.   First, if a line ends with the ";" (semicolon) character, a carriage
  441. return will NOT be stacked.  Second, if "\\HEX" is used where HEX is a
  442.  
  443. number from 01 to FE, then this exact keyboard value will be stacked.  This
  444. is useful for stacking special control characters and symbols.    Third, if
  445. "\\00\\HEX" is used, an extended key code will be stacked.  This is useful
  446. for stacking function keys and the like.  Refer to the Basic manual in
  447. Appendix G under "Extended Codes".  Fourth, if \\FF\\HEX is used, the stack
  448. will delay the keyboard characters from appearing to the program for HEX
  449. number of CPU "ticks".  There are about 12 hex (18 decimal) ticks per
  450. second in the CPU.  In all cases, the word HEX above represents a two digit
  451. hexadecimal number. Finally, \\\\ can be used to stack a single backslash.
  452.  
  453. Some examples...
  454. end
  455.      goto -scroll
  456. -line903 call -header | begtype
  457. Some examples of BEGSTACK command::
  458.  
  459.     BEGSTACK
  460.     \\09 Will stack the tab key.
  461.     This text will be stacked ; 
  462.         on one line!
  463.     \\00\\3B Will stack an F1 key.
  464.     \\\\ is seen as one backslash.
  465.     \\FF\\24 will pause two seconds.
  466.     END
  467.  
  468.  
  469. Hint: Some programs remove keystrokes before accepting a critical key. In
  470. some cases this can be avoided by using \\FF\\01 in the BEGSTACK command.
  471. end
  472.      goto -scroll
  473. -line904 call -header | begtype
  474. Note that in the above examples, the STACK or BEGSTACK commands always are
  475. ~before~ the command or program that will be using the keystrokes. An
  476. example of this order is:
  477.  
  478.     BEGSTACK
  479.     <<keystroke values needed by the program>>
  480.     END
  481.     <<program that will be controlled by the stack>>
  482.  
  483. An example of using the stack with the COPY command within DOS would be:
  484.  
  485.     BEGSTACK
  486.     This text will be given to the copy command.
  487.     \\00\\3B An F1 key ends the copy.
  488.     END
  489.     COPY CON: result.txt
  490.  
  491. end
  492.      goto -scroll
  493. -line905 call -header | begtype
  494. There are also three control commands which are associated with the stack:
  495.  
  496. STACK.OFF     - Redirects data to come directly from
  497.         the physical keyboard. Does not remove
  498.         any data in the stack.
  499.  
  500. STACK.ON      - Directs data to come from the stack.
  501.         This is the default.
  502.  
  503. STACK.PURGE   - Removes any data from the stack and
  504.         keyboard buffers which are pending.
  505. end
  506.     goto -scroll
  507. -line999 %i = 906
  508. -line906
  509.     begtype
  510.  
  511.        ~NOW IT'S YOUR TURN !!!~
  512.  
  513.  
  514.   From our menu, we wish to start up a communications program and
  515. automatically dial a phone number with a smartmodem.  The communications
  516. program we have will take what is typed on the keyboard and send it to the
  517. modem.    The command needed for the modem to dial our phone is
  518. "~ATD12~" .  What Extended Batch Language command will force the
  519. communication program to dial this modem command?
  520.  
  521. end
  522.     %A = "STACK ATD12" | call -tryit
  523. -opt10    %i = 1000
  524. -line1000 %H = "GETTING RESULTS!" | call -header | begtype
  525.   The results of programs often need to be known so that some action can
  526. take place after the program ends.
  527.  
  528.   When the command word READSCRN is seen in the batch file, a line of text
  529. is read from the display screen into variables.  Having the ability to read
  530. text from the display can be useful for determining the result of another
  531. program, or making a query for some system status which would not normally
  532. be available within a batch file.  For example, by reading a directory from
  533. the screen, a series of files can be submitted to the macro assembler.
  534. Once the assembly is completed, the status can be read from the screen to
  535. determine if there were errors which would stop the link step.    Virtually
  536. any message which a program can generate can be used as feedback to a batch
  537. file by using READSCRN.
  538. end
  539.       goto -scroll
  540. -line1001 call -header | begtype
  541.   Its operation is very much like the READ command except for the fact that
  542. the information which is being read is coming from the display screen and
  543. not the keyboard.  Like the READ command, the text from the screen is
  544. tokenized (separated at word boundaries and assigned to variables).  The
  545. return code %R will be reflect the line number on the display that was
  546. read.  This number will be in the range of 1 to 25 for the top to bottom
  547. lines respectively. Once a line is read, this command will be set to read
  548. the previous line. Repeated READSCRN commands will read UP the display!
  549.  
  550. For example:
  551.     CLS
  552.     TYPE HELLO THERE
  553.     READSCRN %A %B %C
  554.  
  555. After execution:
  556.     %A contains HELLO
  557.     %B contains THERE
  558.     %C contains nothing, it is empty.
  559.     %R (return code) contains 1, the line number that was read.
  560. end
  561.       goto -scroll
  562. -line1099 %i = 1002
  563. -line1002
  564.     begtype
  565.  
  566.        ~NOW IT'S YOUR TURN !!!~
  567.  
  568.  
  569.   From our menu, we have started the IBM Macro Assembler program.  We know
  570. that when this program ends, it will display a number representing the
  571. number of errors that were found.  We want to make sure that this number is
  572. zero before continuing to the LINK program.  If we save this number in the
  573. variable~%A~, what is the command to read the assembler result from
  574. the display?
  575.  
  576. end
  577.       %A = "READSCRN %A" | call -tryit
  578. -opt11      %i = 1100
  579. -line1100 %H = ASSIGNMENTS     | call -header| begtype
  580.   If the first character in the command is a '%' (Percent sign), then it is
  581. considered to be an assignment statement.  The first variable cannot be any
  582. predefined variable (such as %R or %%), but may be any of the other
  583. variables %0 to %9 and %A to %O.  If a DOS command is later executed and
  584. uses one of the variables %0 to %9, it will be properly replaced with the
  585. contents of that variable.
  586.  
  587. The first assignment token, the operator, and the final tokens are optional.
  588. The assignment statement must appear in one of the following forms:
  589.  
  590. ~[var] =                      ~- create empty variable
  591. ~[var] = [string]          ~- simple assignment
  592. ~[var] = [number] + [number]  ~- addition
  593. ~[var] = [number] - [number]  ~- subtraction
  594. ~[var] = [number] * [number]  ~- multiplication
  595. ~[var] = [number] / [number]  ~- division
  596. ~[var] = [number] % [number]  ~- remainder
  597. ~[var] = [string] #          ~- string length
  598. ~[var] = [string] $ [index] [length] ~- create substring (like MID$ in BASIC)
  599. end
  600.     goto -scroll
  601. -line1199 %i = 1101
  602. -line1101 call -header | begtype
  603.  ~[var]~ - A DOS variable or global user variable %0 to %9 and %A to
  604. %O.  It may not be a predefined variable.
  605.  
  606.  ~[string]~ - Any valid token.    Letters, numbers, any variable, or any
  607. combination there of.  123, ABC, and 987%J4SF are all valid strings.
  608.  
  609.   ~[number]~ - Any token with a numeric result in the range of ± 2**64.
  610. For example (if %A contains 34) the three numbers 98, %A, and 12%A5
  611. (equivalent to 12345) would all be valid numbers.
  612.  
  613.   ~[index]~ - Same restrictions as [number] above except that an
  614. [index] above 16 is meaningless and is equivalent to the number 16.
  615.  
  616.   ~[length]~ - Same restrictions as [number] above except that a
  617. [length] above 15 is meaningless and is equivalent to the number 15.  Note
  618. that [length] is optional and has a default value of 15.
  619.  
  620. end
  621.     goto -scroll
  622. -line1102
  623.     begtype
  624.  
  625.        ~NOW IT'S YOUR TURN !!!~
  626.  
  627.  
  628.   We wish to count the number of times that a user has used a certain .BAT
  629. program.  We will keep this count in the global user variable~%A~
  630. which will stay active even BETWEEN batch file execution.  What is the
  631. command needed to increase the value in this variable by one?
  632.  
  633. end
  634.     %A = "%A = %A + 1" | call -tryit
  635. -opt12    %i = 1200
  636. -line1103
  637. -line1299 %i = 1200
  638. -line1200 %H = "DEBUGGING AIDS" | call -header| begtype
  639. As an aid in debugging, the TRACE(ALL) function turns on a special flag that
  640. causes each line in the EBL program to be printed as it is executed.  Three
  641. '+' (plus) symbols will precede the EBL statement which is printed out as an
  642. aid.  The trace can be turned off at any time by the TRACE(OFF) function.
  643. The various types of traces that can be done are:
  644.  
  645.     ~Trace(Off)~       Turn off program tracing
  646.     ~Trace(Commands)~  Trace only DOS commands
  647.     ~Trace(All)~       Trace all EBL and DOS commands
  648.     ~Trace(Results)~   Trace commands and expression results
  649.     ~Trace(Intermed)~  Trace commands and intermediate results
  650.  
  651. A trace can be active during DOS commands within the EBL program.  In
  652. addition, trace can be enabled/disabled at any time, even in immediate mode.
  653. Once enabled, it will remain in effect until the TRACE(OFF) command is
  654. executed.  Errors, execution of other EBL language files, and even executing
  655. DOS commands will not change the trace mode.
  656. end
  657.       goto -scroll
  658. -opt13
  659. -line1201 %i = 1300
  660. -line1300 %H = "Functions" | call -header| begtype
  661.  
  662. Built into EBL Plus is a large set of useful functions.  These functions
  663. are helpful when writing advanced EBL programs.  In general, you could
  664. write almost all of your EBL programs without using these functions.
  665. Occasionally, there may be some special need for a unique operation that is
  666. not a part of the standard commands built into Extended Batch Language.
  667. For these advanced needs, we have written a rich library of Extended
  668. Functions.
  669.  
  670. end
  671.     goto -scroll
  672. -line1301 call -header | begtype
  673. ~The following 45 functions are built into BAT.COM.~ If you include
  674. the various attributes each can have, there are thousands of combinations.
  675.  
  676.   CENTER()     EDIT()     LOWER()        SEEK()          VERSION()
  677.   CHDIR()     EXIST()    MKDIR()        SELECT()       WHATFUNC()
  678.   CHARIN()     FIELD()    NOT()           SPACE()          WINDOW()
  679.   COLOR()     FIND()     PEEK()           STRIP()          WORD()
  680.   COPIES()     GETDIR()    PLAY()           SUBWORD()      WORDS()
  681.   CURSOR.COL()     INT86()    POKE()           TIME()
  682.   CURSOR.ROW()     KEY()        RANDOM()       TRACE()
  683.   DATE()     KEYPRESSED()    REVERSE()      TRANSLATE()
  684.   DELWORD()     LEFT()     RIGHT()        UPPER()
  685.   DIR()      LENGTH()    RMDIR()        VERIFY()
  686.  
  687. end
  688.     goto -scroll
  689. -line1302 call -header | begtype
  690. These functions can be used any place a variable or other values
  691. can be used.  For instance, they can be used in an expression:
  692.  
  693.     %A = LEFT( %B, 8 )
  694.  
  695. They can be used in a condition statement:
  696.  
  697.     If KEYPRESSED() then goto -Had.Key
  698.  
  699. Or they can be used in combination with each other:
  700.  
  701.     Type "The hour is now:" CENTER( TIME(), 20, "-" )
  702.  
  703. In general, external functions can be very powerful additions to Extended
  704. Batch Language.  Registered users receive details of how to add their own
  705. custom additions using external functions.  The BAT-BBS as been a
  706. repository for all new functions from other users.
  707. end
  708.       goto -scroll
  709. -line1303 call -header | begtype
  710.  
  711. EBL functions are organized into four categories....
  712.  
  713. ~CONSOLE~
  714.  
  715.   CHARIN()
  716.   COLOR( names )
  717.   CURSOR.ROW()
  718.   CURSOR.COL()
  719.   EDIT( field color )
  720.   FIELD( field number {,field color} )
  721.   KEY( name )
  722.   KEYPRESSED()
  723.   PLAY( notes )
  724.   SELECT( Field Color {,Bar Color {,Arrow}} )
  725.   WINDOW( X1, Y1, X2, Y2 {, Kind } )
  726. end
  727.     goto  -scroll
  728. -line1304  call   -header  |  begtype
  729. ~STRING~
  730.  
  731.   CENTER( string, i {, pad} )
  732.   COPIES( string, n )
  733.   DELWORD( string, n {, length} )
  734.   FIND( sentence, phrase )
  735.   LEFT( string, i {, pad} )
  736.   LENGTH( string )
  737.   LOWER( string )
  738.   REVERSE( string )
  739.   RIGHT( string, i {,pad} )
  740.   SPACE( string, n {, pad} )
  741.   STRIP( string {, type {, char}} )
  742.   SUBWORD( string, n {, length} )
  743.   UPPER( string )
  744.   VERIFY( string, reference )
  745.   WORD( string, n )
  746.   WORDS( string )
  747. end
  748.     goto  -scroll
  749. -line1305  call  -header  |   begtype
  750. ~SYSTEM~
  751.  
  752.   CHDIR( directory )
  753.   DATE( {type} )
  754.   DIR( file {,type {,attribute}} )
  755.   EXIST( file )
  756.   GETDIR()
  757.   INT86( intr, regs )
  758.   MKDIR( directory )
  759.   PEEK( locn )
  760.   POKE( locn, value )
  761.   REBOOT
  762.   RMDIR( directory )
  763.   SEEK( r/w, posn )
  764.   TIME( {type} )
  765. end
  766.     goto -scroll
  767. -line1306 call -header | begtype
  768.  
  769. ~EBL/CONTROL~
  770.  
  771.   NOT( expression )
  772.   TRACE( type )
  773.   VERSION()
  774.   WHATFUNC()
  775.  
  776.  
  777. end
  778.     goto -scroll
  779. -opt14
  780. -line1307 %H = "CONSOLE FUNCTIONS"| %i = 1307| call -header | begtype
  781. ~CONSOLE FUNCTIONS~
  782.  
  783. The console group  of functions interact  with the screen and keyboard that
  784. the user sees. Functions can be used anywhere  other values or    expressions
  785. are  used.  For  example,  in  an  assignment  statement,  an  IF  or  TYPE
  786. statement, and so on.
  787.  
  788. ~CHARIN()~  This function  waits for a single  keystroke then  returns    its
  789.      value.  If a function key is pressed, the entire key name is returned.
  790.      The key is not  echoed to the screen.
  791.  
  792.          if CHARIN() = "F3" then goto -showhelp
  793.  
  794. ~COLOR( color name {{on} color name} )~  This function converts one or more
  795.      color names  into its corresponding hexadecimal attribute.  The result
  796.      can be used in menus within the BEGTYPE command.  If used by itself as
  797.      a keyword, this function will set the default color of any future text
  798.      to be printed with either the TYPE or BEGTYPE commands.
  799.          COLOR( White On Cyan )
  800. end
  801.     goto -scroll
  802. -line1308 call -header | begtype
  803. ~CURSOR.ROW()
  804.  
  805. CURSOR.COL()~  This  function  returns the cursor's current  row  or column
  806.      position.    It  is useful when  you want  to  hold    the  current cursor
  807.      position so that you can use LOCATE to  return  the cursor to the same
  808.      point.
  809.  
  810.          %0 = cursor.row()
  811.  
  812. ~EDIT( field color )~  This  function  allows  any text on the screen to be
  813.      edited interactively.  The  screen  is  first set with  the fields  or
  814.      areas to edit, marked with a field color.    Then the EDIT() function is
  815.      used to allow the user to    interactively  modify and create text right
  816.      on  the screen.  Only colored areas on the screen that match the field
  817.      color  can  be  modified.    The name of  the  exit key pressed  will be
  818.      returned as the value of this function.
  819.  
  820.        EDIT( COLOR( Yellow on Cyan ))
  821.  
  822. end
  823.     goto -scroll
  824. -line1309 call -header | begtype
  825. ~FIELD( field number {,field color} )~    This   function  returns  the  text
  826.      contents of a screen field.  Field  numbers  are  counted from the top
  827.      left  of  the screen sequentially to  the    bottom    right.    Fields    are
  828.      identified by a specific field color  on the display.
  829.  
  830.          %A = FIELD( 1 , color( Yellow on Cyan))
  831.  
  832. ~KEY( name )~  When used outside  an expression, this function will put the
  833.      named key on the keyboard stack.
  834.  
  835.          KEY(PgUp)
  836.  
  837.      If the name is plain text and not a key name, then the plain text will
  838.      be stacked instead.
  839.  
  840.          KEY("Any Words...")
  841.  
  842.      If "KEY(PAUSE)" is used outside an expression, then this function will
  843.      put a one second delay on the keyboard stack.
  844. end
  845.     goto -scroll
  846. -line1310 call -header | begtype
  847.  
  848. ~KEYPRESSED()~ This function returns the letter "F" if the keyboard has not
  849.      been  pressed, and the letter "T"  if  any key has  been pressed.  The
  850.      result is    obtained  by calling the  operating  system console  status
  851.      routine.
  852.  
  853.          if keypressed() then goto -checkit
  854.  
  855. ~PLAY( notes )~  This  function  converts   a  list  of   notes   into    the
  856.      corresponding sound.  Up  to 50 notes and    rests can  be played in the
  857.      background.  The notes  available    are the same as in BASIC.  To avoid
  858.      confusion, strings of notes should always be enclosed by quotes.
  859.      %A = "GFE-FGGG"
  860.      PLAY( "T200" %A "P FFFP G>CCP <" %A "GFFGFE-..." )
  861. end
  862.     goto -scroll
  863. -line1311 call -header | begtype
  864. ~SELECT( Field Color {,Bar Color {,Arrow}} )~ This function allows the user
  865.      to select one item from a list  of several items using  the cursor.  A
  866.      moving bar indicates  which item  can be  selected.  The position, and
  867.      length of    the bar, is limited to the areas on the  screen  using    the
  868.      field color.  The default bar color is inverted video.  The arrow keys
  869.      can move  the bar in any  direction.  Any Function Key, ESC,  or Enter
  870.      key will exit the function.  This function returns the name of the key
  871.      used to exit. The value in %R indicates the field number selected.
  872.          colorchar * as color(cyan)
  873.          cls type "Select option *one* or *two*"
  874.          select( color(cyan) )
  875.  
  876. ~WINDOW( X1, Y1, X2, Y2 {, Kind } )~ This function draws a rectangular area
  877.      on  the display.  The area is defined  by the X1, Y1  location of    the
  878.      top left corner, and the X2, Y2  location    of the bottom right corner.
  879.      The color used is based on the last COLOR command executed.  There are
  880.      several types  of    borders available.  Only  the  first  letter in the
  881.      border  name is required.    Kinds  are: Blank,  Combo, Highlighted, 3D,
  882.      Double line, Single line.
  883. end
  884.     goto -scroll
  885. -opt15
  886. -line1312 %H = "STRING FUNCTIONS"| %i = 1312| call -header | begtype
  887.  
  888. ~STRING FUNCTIONS~
  889.  
  890. The string group of functions perform various operations on characters.  As
  891. with other functions, they can be used anywhere other values or expressions
  892. are  used.  For  example,  in  an  assignment  statement,  an  IF  or  TYPE
  893. statement, and so on.
  894.  
  895. ~CENTER( string, length {,pad} )~
  896. ~CENTRE( string, length {,pad} )~ This    function returns a character string
  897.      of  length  length.  The  center-most  characters    of the    string    are
  898.      returned.    The default pad at both sides is a blank.
  899.  
  900.      CENTER( "ABC", 8, '-' )                   ==  '--ABC---'
  901.  
  902. ~COPIES( string, n )~  This function returns n copies of the string.
  903.  
  904.      COPIES('Two-',2)                    ==  'Two-Two-'
  905. end
  906.     goto -scroll
  907. -line1313 call -header | begtype
  908. ~DELWORD( string, n {, length} )~
  909.      This function removes a portion of the string starting
  910.      at the nth word. A length amount of words separated
  911.      by blanks will be removed. If length is not used, it will
  912.      remove all remaining words in the string.
  913.      DELWORD('now is the time',2,2)  == 'now time'
  914.  
  915. ~FIND( sentence, phrase )~
  916.      This function finds the phrase string within the
  917.      sentence string. If found, it will return the position
  918.      of the first matching word in the sentence. If not found,
  919.      it will return 0.
  920.      FIND('now is the  time','the time') ==  3
  921.  
  922. ~LEFT( string, length {,pad} )~ This function returns a character string of
  923.      length  length.  The left-most  characters of  the  input    string    are
  924.      returned.
  925.      LEFT( "ABC", 8, '-' )               == 'ABC-----'
  926. end
  927.     goto -scroll
  928. -line1314 call -header | begtype
  929.  
  930. ~LENGTH(string)~   This  function returns the  number  of  characters in the
  931.      'string'.
  932.      LENGTH('abcdefgh')                  == 8
  933.  
  934. ~LOWER(string)~  This  function  returns   a   character   string  with  all
  935.      characters converted to lower case.
  936.      LOWER("abcDEF")                     == abcdef
  937.  
  938. ~REVERSE( string )~  This  function  will  reverse  the  letters  within  the
  939.      string end for end. The reversed string is returned to the caller.
  940.  
  941.      REVERSE('Abc defg')  ==  'gfed cbA'
  942.  
  943. ~RIGHT(string,length{,pad})~  This  function  returns  a character  string of
  944.      length length.  The right-most  characters  of  the  input string    are
  945.      returned.
  946.      RIGHT("ABC",8,'-')                  ==  '-----ABC'
  947. end
  948.     goto -scroll
  949. -line1315 call -header | begtype
  950.  
  951. ~SPACE( string, {n {, pad}} )~    This  function changes the  spacing  of the
  952.      string to be  n blanks between each word. If n  is  0, then all blanks
  953.      are removed.
  954.      SPACE(' abc def  ',1,'-')   == 'abc-def'
  955.  
  956. ~STRIP( string {,type {,char}} )~ This function removes a character from the
  957.      sides of  the  string.  The  type    parameter  may be "B"  (Both),  "L"
  958.      (Leading), or "T" (Trailing) for  the three  types  of  striping.  The
  959.      default  character to  be striped from  the sides of the string  is  a
  960.      blank.
  961.      STRIP( "   AB C   ")                ==  'AB C'
  962.      STRIP( 00012.700, T, '0' )          ==  '00012.7'
  963.  
  964. ~SUBWORD( string, n {, length} )~  This  function  returns a portion of the
  965.      string  starting  from  the  nth  word  for  length   words  long.  If
  966.      length is omitted, the remainder of the string is returned.
  967.      SUBWORD("now is the time",2,2)   == 'is the'
  968. end
  969.     goto -scroll
  970. -line1316 call -header | begtype
  971.  
  972. ~UPPER( string )~  This   function  returns  a    character string  with    all
  973.      characters converted to upper case.
  974.      UPPER("ABC/def/Ghi")   ==   'ABC/DEF/GHI'
  975.  
  976. ~VERIFY( string, reference )~  This  function  verifies that the  string is
  977.      composed  only  of  characters in    the  reference    string.  The  first
  978.      non-matching   character  position  in  string  is  returned.  If    all
  979.      characters in the string are in the reference, then 0 is returned.
  980.      VERIFY( "$12.95","0123456789.$")    ==  0
  981.      VERIFY( "$12xxx","0123456789.$")    ==  4
  982.  
  983. ~WORD( string, n )~ This function returns the nth blank delimited word from
  984.      the string.
  985.      WORD('Powerful new EBL features',2) ==  'new'
  986. end
  987.     goto -scroll
  988. -line1317 call -header | begtype
  989.  
  990. ~WORDS( string )~  This function returns the number of blank delimited words
  991.      within the string.
  992.  
  993.      WORDS(' ')                          ==  0
  994.      WORDS('Power house capability')     ==  3
  995.  
  996. end
  997.     goto -scroll
  998. -opt16
  999. -line1318 %H = "SYSTEM FUNCTIONS"| %i = 1318| call -header | begtype
  1000. ~SYSTEM FUNCTIONS~
  1001.  
  1002. The System  Functions  are  use  to  get  the status of  the  computer, and
  1003. performs various operations on the files of a hard disk or floppy disk.  As
  1004. with other functions, they can be used anywhere other values or expressions
  1005. are  used.  For  example,  in  an  assignment  statement,  an  IF  or  TYPE
  1006. statement, and so on.
  1007.  
  1008. ~CHDIR( directory_name )~  The current sub-directory is  changed to the new
  1009.      directory_name.  CHDIR() returns no value.
  1010.  
  1011.      CHDIR("c:\\newdisk")
  1012.  
  1013. ~DATE( {type} )~ This function returns a  character string representing the
  1014.      system date.  The default    DATE() function without a type    will return
  1015.      the system date  in  the format  'dd Mmm yyyy'.  For example, it would
  1016.      return a date in the form '2 Sep 1989'.  Other forms are: 'C' Century,
  1017.      'D'  Days,  'E'  European,  'J'  Julian,  'M'  Month, 'N'  Normal, 'O'
  1018.      Ordered, 'S' Standard, 'U' USA, and 'W' Weekday.
  1019. end
  1020.     goto -scroll
  1021. -line1319 call -header | begtype
  1022.  
  1023. ~DIR( filename {,type {,attribute}} )~ This  function is a  superset of the
  1024.      EXIST() function.    It  can return    any information  about the files on
  1025.      the disk.    The type  and attribute  portions are optional.  If neither
  1026.      are used, the result is identical to the EXIST() function.  A  summary
  1027.      of options follows.  Results  shown  are typical but may  be different
  1028.      than   your  results.  The  following  types  of  information  can  be
  1029.      returned:
  1030.      ~DIR( filename )  ~     - See if the filename exists
  1031.      ~DIR( filename, I)~     - Index to next matching file name
  1032.      ~DIR( filename, A)~     - file Attributes
  1033.      ~DIR( filename, D)~     - file Date (attribute is optional, see DATE()
  1034.      ~DIR( filename, T)~     - file Time (attribute is optional, see TIME()
  1035.      ~DIR( filename, S)~     - file Size
  1036.      ~DIR( filename, N)~     - file Name
  1037.      ~DIR( filename, P)~     - Position of file within DOS directory
  1038.      ~DIR( position, R)~     - Return to Index position
  1039. end
  1040.     goto -scroll
  1041. -line1320 call -header | begtype
  1042. ~EXIST( file )~ EXIST(filename)  determines  if a file is in the  directory.
  1043.      It returns the file name if it does exist, and a NULL value if it does
  1044.      not exist.  The file  name can contain a  complete  path  and the wild
  1045.      characters * or ?.  It is easily combined with the IF command like:
  1046.  
  1047.      IF EXIST("FILE.TXT") THEN ..statement..
  1048.  
  1049. ~GETDIR()~The current sub-directory name of  the default drive is returned.
  1050.      The name  will be a  valid,  fully qualified,  path name including the
  1051.      current default drive.  For  example, if the current  directory is the
  1052.      root directory on drive C, a "C:\\" will be returned.
  1053.  
  1054. end
  1055.     goto -scroll
  1056. -line1321 call -header | begtype
  1057.  
  1058. ~INT86( intr, regs )~ This function  executes  an  8086 software interrupt.
  1059.      CAUTION!  The INT86()  function  is for advanced programming functions
  1060.      only.  The  intr value is a hex number from 00 to FF of  the  software
  1061.      interrupt to be executed.    The regs  value is a series  of  hex values
  1062.      for AX BX CX DX SI DI DS and ES in that order.  They  are    word values
  1063.      given in hex and  separated by  blanks. The notation  %%A    may also be
  1064.      used  to indicate the  address  of the variable %A. This function will
  1065.      return the values of AX  BX CX DX SI DI DS ES and    FLAGS in that order
  1066.      after the interrupt has executed.
  1067.  
  1068.      %A = Hello$
  1069.      INT86( 21 0900 0 0 %%A 0 0 %%A )
  1070.  
  1071. ~MKDIR(directory_name)~  A new sub-directory is created with this function.
  1072.      This new  name  can include a  default drive name.  The directory name
  1073.      can not exceed 63 characters.
  1074.  
  1075. end
  1076.     goto -scroll
  1077. -line1322 call -header | begtype
  1078.  
  1079. ~PEEK(location)~  This function  returns  a  byte of  memory,  in  hex,  at
  1080.      location.    The  hex  value returned  is  always  two  characters.    The
  1081.      location  is a two part hex value and  contains both a segment  and an
  1082.      offset,  separated   by  a  colon    ":".   For  example,  the  location
  1083.      "0040:01A4"  would represent  segment 0040  and  offset 01A4.  If  the
  1084.      segment is not present, it is assumed to be zero.    If both segment and
  1085.      offset are supplied, then the colon ':' between them is required.
  1086.  
  1087. ~POKE(location,value)~    This  function    writes     a   byte   of    memory    at
  1088.      location  with the contents of value.  No    value is returned from this
  1089.      function after the  write.  Location  is  a  two  part hex  value    and
  1090.      contains  both a segment and  an offset separated by a colon ":".  For
  1091.      example,  the location "0040:01A4" would  represent  segment 0040  and
  1092.      offset 01A4.  If the segment is not present, it is assumed to be zero.
  1093.      If  both segment and offset are supplied, then  the colon ':'  between
  1094.      them is required.
  1095.  
  1096. end
  1097.     goto -scroll
  1098. -line1323 call -header | begtype
  1099.  
  1100. ~REBOOT~ This  command initializes the PC  by  starting the bootstrap (IPL)
  1101.      procedure.  This  is  equivalent    to  pressing  CTRL-ALT-DEL  on    the
  1102.      keyboard.    Once  this command  is executed,  all programs are  removed
  1103.      from memory  (including EBL)  and the  system will reload    from either
  1104.      diskette or hard disk.  If the system  is a  PC compatible, the memory
  1105.      test will be avoided which will speed up the re-booting process.
  1106.  
  1107. ~RMDIR(directory_name)~   An empty sub-directory   is  removed    with   this
  1108.      function.    The name can  include  a default drive name.  The directory
  1109.      name cannot exceed 63 characters.    DOS requires that the sub-directory
  1110.      be  completely empty of both files and other sub-directories before it
  1111.      can be removed.
  1112. end
  1113.     goto -scroll
  1114. -line1324 call -header | begtype
  1115. ~SEEK( r/w {,position} )~  This function can  be  used to find the location
  1116.      within a file that is are being read or  written.    It can also be used
  1117.      to change that  position.    This  can  be  used to    create    files  with
  1118.      special formats, or to allow files to be randomly accessed.
  1119.  
  1120.      The first parameter r/w is required.  It may be either "<" or "R" for
  1121.      the file currently being read, or ">" or "W" for the file being written.
  1122.  
  1123.      If  this  is  the only parameter  supplied,  the  SEEK() function will
  1124.      return the current I/O position in  the  file.  This  value  will be a
  1125.      decimal offset from the beginning of the file.
  1126.  
  1127.      If position  is supplied, the file position will  be moved to this new
  1128.      location.    The  position  must  be  a  positive  decimal  number.
  1129.      If position  is 'EOF', the file position  will be moved to the  end of
  1130.      the file.
  1131.         BAT * Show file size
  1132.         <TEST.FIL
  1133.         TYPE "File contains" SEEK(R,EOF) "bytes"
  1134. end
  1135.     goto -scroll
  1136. -line1325 call -header | begtype
  1137.  
  1138. ~TIME( {type} )~  This function returns a character string representing the
  1139.      system time.  In the case of the  TIME() function without a type,    the
  1140.      time returned will be in the default 24-hour clock format    'hh:mm:ss'.
  1141.      For example, it might be '04:41:37'.
  1142.  
  1143.      It is also possible to obtain other formats by using the type operand.
  1144.      Type  is  a single character used to  indicate  the type of  alternate
  1145.      format  desired.  The possible formats  are: 'C' Civil, 'H' Hours, 'L'
  1146.      Long, 'M' minutes, 'N' Normal, 'S' Seconds, or a number N to start  an
  1147.      N second timer.
  1148.  
  1149.     BAT * TIME() example
  1150.     Type "This example started at" TIME() "on" DATE()
  1151.     Type "Waiting 4 seconds..."
  1152.     Wait until TIME(4)
  1153.     Type "Done!"
  1154.  
  1155. end
  1156.     goto -scroll
  1157. -opt17
  1158. -line1326 %H = "CONTROL FUNCTIONS"| %i = 1326| call -header | begtype
  1159.  
  1160. ~EBL/CONTROL FUNCTIONS~
  1161.  
  1162. The  EBL Control Functions determine the status of EBL    and  the  functions
  1163. being used. Like other functions, they can be used anywhere other values or
  1164. expressions are used.  For  example, in an assignment  statement, an IF  or
  1165. TYPE statement, etc.
  1166.  
  1167. ~NOT( expression )~ The NOT()  function reverses the results of  true/false
  1168.      expressions.  This  is useful in IF  statements that use an expression
  1169.      or function to determine the next direction.
  1170.  
  1171.  
  1172. ~VERSION()~ This function returns information describing the language level
  1173.      and  the  release    date of  this level.  It  consists  of    five  words
  1174.      separated by blanks.  For example
  1175.      VERSION()  ==    "EBL 4.01a 23 Dec 1989"   (Perhaps)
  1176.  
  1177. end
  1178.     goto -scroll
  1179. -line1327 call -header | begtype
  1180. ~TRACE( type )~  As an aid in debugging,  the  TRACE() function  enables  a
  1181.      trace flag which causes various types of  information to  be displayed
  1182.      as the EBL program executes.
  1183.  
  1184.      These traces are listed from the most quiet to the most verbose.  When
  1185.      a    more  verbose  level is active, all less  verbose results are  also
  1186.      shown.  For  example, TRACE(R) shows results,  all EBL statements, and
  1187.      DOS commands.
  1188.  
  1189.      -Trace Type-  -Meaning-           -Symbols during Tracing-
  1190.     Trace()      Tracing off     none
  1191.     Trace(O)     Tracing Off     none
  1192.     Trace(C)     DOS Commands     none
  1193.     Trace(A)     All statements     *-*
  1194.     Trace(R)     Results         *-*, >>>
  1195.     Trace(I)     Intermediates     *-*, >>>, >F>, >E>, >V>, >L>
  1196. end
  1197.     goto -scroll
  1198. -line1328 call -header | begtype
  1199. ~WHATFUNC()~ This command  should  be built into  all  function packages to
  1200.      identify  what is    loaded    and available.    This function is special in
  1201.      that  all external function package ID's  will  be  appended together.
  1202.      Each ID name will be separated by a  single space.  From  this  result
  1203.      you  can determine the order the functions were loaded, the  number of
  1204.      external functions available,  the  names of  each  package,  and    the
  1205.      functions associated with them.
  1206.  
  1207.      The ID  names for    the  set of external  functions provided by Seaware
  1208.      are:
  1209.      Program Name         ID Name
  1210.      Built into EBL      BATFUNC1.BATFUNC2
  1211.      BATMATH3.COM         BATMATH3
  1212. end
  1213.     goto -scroll
  1214. -line1329 call -header | begtype
  1215. ~EBL OPTIONS~
  1216.  
  1217. A number of features within Extended Batch  Language are controlled through
  1218. EBL  options.  An  EBL option consists    of  a forward  slash  "/"  followed
  1219. immediately by an option  letter.  This will  set the requested feature  as
  1220. long as EBL remains active and does not return    to DOS. If you need to exit
  1221. to DOS    (for instance with a DOS command or  with the LEAVE statement), you
  1222. may wish to turn on the option again when EBL resumes its processing.
  1223.  
  1224. All  EBL  options   have  default  values.  These  have  been    chosen    for
  1225. compatibility with previous EBL  and for ease of use.  Using  these options
  1226. may change how your EBL program is written.
  1227.  
  1228. ~ /A            ~- Any DOS version, use with 4DOS and other types of DOS
  1229. ~ /K            ~- Kill
  1230. ~ /R [filename]     ~- Run new file
  1231. ~ /W            ~- DesqView/MS Windows support
  1232. ~ BIOS, RAM, or ANSI~- display speeds
  1233. end
  1234.     goto -scroll
  1235. -opt18
  1236. -line1399
  1237. -line1330 %H = "ADD-ON FUNCTIONS"| %i = 1330| call -header | begtype
  1238. ~ External Add-on Functions:~
  1239.  
  1240. Just like all the built-in functions previously described, you can add-on
  1241. your own custom functions external to EBL.  External Functions give
  1242. Extended Batch Language additional capabilities.  Within external functions
  1243. you can create helpful routines in writing complex EBL programs.
  1244. Generally, you will be able to write almost all of your EBL programs
  1245. without these functions.  Occasionally there may be some special need for a
  1246. unique operation that is not part of the commands built into Extended Batch
  1247. Language.  External functions can therefore be added to EBL as needed.
  1248.  
  1249. The most popular external functions from EBL version 3 (from BATFUNC1.COM
  1250. and BATFUNC2.COM) have been incorporated into EBL-PLUS.  Additional
  1251. functions and ideas are always invited.  The BAT-BBS is a repository for
  1252. these programs (407/738-1843).
  1253. end
  1254.     goto -scroll
  1255. -opt19
  1256. -line1331 %i = 1400
  1257. -line1400 %H = "Additional Information" | call -header| begtype
  1258. ~Additional Information~
  1259.  
  1260. The size of the keyboard stack defaults to 1024 bytes.    This value can be
  1261. changed by making the first statement which is executed by the Extended
  1262. Batch Language program be of the form:    BAT * size.  Size is the decimal
  1263. number of bytes to reserve for the stack.  This must be executed, for
  1264. instance, when a system reset is performed because once this area is
  1265. installed, the size is never altered until another system reset.
  1266.  
  1267. There are additional variables %A thru %O (oh) which are called "global
  1268. user variables".  These variables are used exactly like the variables
  1269. supplied by DOS (%0 to %9) with two exceptions.  First, the contents of
  1270. these variables are maintained between execution of batch files for as long
  1271. as the system is powered on.  This "global" feature is useful for keeping
  1272. indicators BETWEEN "sessions" of the user.  Second, because DOS does not
  1273. know about these variables, they~can not~be used as variables within any
  1274. DOS command.  So while "COPY %1 %2" is valid, "COPY %A %B" is not.  If you
  1275. wish to use them within DOS commands, they must first be copied via a
  1276. statement like "BAT %1 = %A".
  1277. end
  1278.       goto -scroll
  1279. -line1401 call -header | begtype
  1280.   PREDEFINED VARIABLES...
  1281.  
  1282. A return code is available at memory address [0000:04FE].  If set by a
  1283. program, EBL can read this byte value with the variable %R.  The string
  1284. stored into this variable is in hex with leading zeros truncated.
  1285.  
  1286. The current default drive is stored into the %V variable.  It is a single
  1287. character.
  1288.  
  1289. The status of the stack is stored into the %Q variable.  It is a "K" if the
  1290. READ command will be reading from the keyboard, and a "S" if it will be
  1291. reading from the stack area.
  1292.  
  1293. There are two character literals.  %S represents a space literal and %%
  1294. represents a percent sign.  Either of these special variables can be stored
  1295. into other variables, or used for testing special cases.
  1296. end
  1297.       goto -scroll
  1298. -line1402 call -header | begtype
  1299.   If a you wish to put more than one command on a line, the vertical bar
  1300. "|" is useful.  When used with an IF command and the test for the IF
  1301. conditions fail, the entire rest of the line will be ignored.  Multiple
  1302. commands within a EBL statement is very useful when combined with the IF
  1303. command.  For example:
  1304.  
  1305.     IF %A = abc TYPE this | CALL -that | GOTO -other
  1306.  
  1307.   If a comment is needed within an EBL program, the "*" (star) character is
  1308. useful.  When used after the word EBL, all characters which follow will be
  1309. ignored.  For example:
  1310.  
  1311.     * This is a comment to the programmer.
  1312. end
  1313.       goto -scroll
  1314. -line1403 call -header | begtype
  1315. If you still need more information, you might wish to call the BAT-BBS
  1316. hotline at 407/738-1843.  You may also order Seaware products on the BAT-BBS.
  1317. Refere to section 3 for further BBS information.
  1318.  
  1319. Fully registered users will receive a password to the BAT-BBS hot-line to get
  1320. updates, ask questions, and get helpful tips and examples.  You will also
  1321. receive a diskette full of example EBL programs, and samples of how to create
  1322. your own add-on functions including source code.  In addition, the printed
  1323. manual you receive gives complete descriptions on all available commands with
  1324. examples of each.  We feel that user supported software should be a two way
  1325. street.  With your help, it will work.
  1326.  
  1327. If you find this program of value, you may purchase it for $79 at the
  1328. address below.    For further information, see section 2 of this document.
  1329.  
  1330.  Seaware Corp.                              407/738-1712
  1331.  Post Office Box 1656                          800/634-8188
  1332.  Delray Beach, FL 33444
  1333. end
  1334.     goto -scroll
  1335.  
  1336. -on.error-
  1337.     %e = %e + 1 | if %e > 2 then %L = ? | skip 4
  1338.     if %R <> 6 then skip 7
  1339.     %G = .goto.
  1340.     color 8f |type "Loading part 1 ..."
  1341.     leave
  1342.     batdoc
  1343. bat *
  1344. bat beep type "ERROR! BATDOC.BAT overlay is missing!"
  1345. bat exit
  1346.  
  1347. begtype
  1348.  
  1349.      Unexpected error \%S%R in line \%S%L !
  1350.  
  1351.      This batch file was error free when it was distributed
  1352.      by Seaware. An error indicates that it was most likely
  1353.      modified by someone improperly. To get an updated demo
  1354.      diskette send $10 to Seaware directly or call 800/634-8188
  1355.      or 407/738-1712.
  1356.  
  1357.  
  1358.             Seaware Corp.
  1359.              Post Office Box 1656
  1360.             Delray Beach, FL 33444
  1361. end
  1362. %G =
  1363. %E = 0
  1364. exit
  1365.