home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Hall of Fame
/
HallofFameCDROM.cdr
/
prog1
/
ebl-bat3.lzh
/
BATDOC2.BAT
< prev
next >
Wrap
DOS Batch File
|
1989-02-13
|
31KB
|
836 lines
bat /p * Loading HELP and DOCUMENTATION part 2
* Written by F.Canova 10/5/83 through 07/7/86
* (c) Copyright 1983, 1985, 1986 by Seaware Corp. all rights reserved.
* This batch file REQUIRES EBL Version 3 for proper execution!
**** NOTE! NOTE! NOTE! NOTE! ****
RAM |* <-----Change 'RAM' to 'BIOS' if PC isn't 100% IBM Compatible!
if %G = .goto. then %G = | goto -%F
beep type Error! Begin by using BATDOC first!
type This file is an overlay to BATDOC.
exit
-opt0 %F = opt0 | skip 3
-line0 %F = line0 | skip 2
-line599 %F = line599 | skip 1
-line1405 %F = line1405
%G = .goto.
color 8f |type Loading part 1 ...
color 07 |type
leave
batdoc
-header * Routine prints general purpose header for help text
stack.purge |* remove any pre-typed keystrokes.
%n = %i $ 1 ( %i # - 2 ) & . & ( %i $ ( %i # - 1 ) 2 ) |* extract section # from page #
cls begtype
\17╔══════════════════════════════════════════════════════════════════════════════╗\1F
\%H Page \%n \17
╚══════════════════════════════════════════════════════════════════════════════╝\07
Press: PGDN for next page, PGUP for prev page, HOME for main menu.
end
return
-scroll * Routine accepts key for scrolling help text
%e = 0
inkey %k
if %k = KEY003 goto -opt0 |* Break key
if %k = KEY01B %i = 0 | goto -line0 |* ESC key
if %k = KEY147 %i = 0 | goto -line0 |* Home key
if %k = KEY149 %i = %i - 1 | cls | goto -line%i |* PgUp key
if %k = KEY151 %i = %i + 1 | cls | goto -line%i |* PgDn key
goto -scroll |* ignore any other key.
* ROUTINE TO HAVE USER GIVE A COMMAND A TRY !!
* %A = string which must match
-tryit
begtype
Enter your guess! ;
end
-tryit.loop
if .%a = . goto -tryit.solved.it |* end of string ?
%b = %a $ 1 1 |* get 1st letter
%a = %a $ 2 |* remove it from string
-tryit.retry
inkey %k |* get a key.
if %k = KEY020 type %b; | goto -tryit.loop
if %k = KEY01B type %b%a| goto -tryit.give.up
if %k = %b type %k; | goto -tryit.loop
beep goto -tryit.retry
-tryit.solved.it
begtype
EXCELLENT !! - that's exactly it!
end
read Press the ─┘ key to continue to next section.....
return
-tryit.give.up
begtype
That's the answer you needed! (You can "peek" at part of
the answer next time by pressing the space bar if you'd like.)
end
read Press the ─┘ key to continue to next section.....
return
-opt6
-line503 %i = 600
-line600 %H = "How to print" | call -header| begtype
The simplest thing to for Extended Batch Language to do is to print text
on the display. This is done by either of two commands, TYPE and BEGTYPE.
The TYPE command can be used for something as simple as saying hello!
Let's look at a simple EBL batch file...
BAT /P /S <This starts up EBL. Use it at the top.
TYPE "HELLO WORLD" <This types a message
This is all that is needed. This command can be typed directly from DOS
(this is called immediate mode) or be entered into a file such as
"TRIAL.BAT" (this is called direct execution mode). To execute it as a EBL
program with the file, just type the file's name "TRIAL" from DOS and you
will see the results of the program "HELLO WORLD" coming from EBL.
end
goto -scroll
-line601 call -header | begtype
You can also put DOS variables into this command to display their
contents. For example, if the "TRIAL.BAT" file contained the line:
BAT /P /S <This starts up EBL. Use it at the top.
TYPE "HELLO THERE" %1 %2 <This types a message & two variables
Then when we start the BAT program from DOS, we might enter:
TRIAL COMPUTER USER
DOS will automatically store the words after the program name into its
variables. Therefore, in the TYPE command, we will see contents of these
variables on the screen. That is 'COMPUTER' -> %1 and 'USER' -> %2.
The resulting message would be:
HELLO THERE COMPUTER USER
In the upcoming examples we will not show 'BAT /P /S', but always use it at
the top of any batch file when you want EBL to work on the file.
end
goto -scroll
-line602 call -header | begtype
There is a second method of putting text onto the display. This is with
the BEGTYPE command. Although it will not display the contents of
variables, it is very useful for displaying large blocks of text, such as
menus. For example, if the "TRIAL.BAT" file contains:
BEGTYPE
This is a large block of text. It is useful for menus. Note
that Upper/Lower case characters are displayed intact here.
The block is always ended with "END" in the first column
after the text finishes.
END
When executed, the "TRIAL.BAT" program will display:
This is a large block of text. It is useful for menus. Note
that Upper/Lower case characters are displayed intact here.
The block is always ended with "END" in the first column
after the text finishes.
end
goto -scroll
-line699 %i = 603
-line603 call -header | begtype
There is an additional advantage to using BEGTYPE command. This command
can also highlight text to the user. This is done by using the form:
[\\hex] within the text block.
For example if the text block contained \\0F within the text, the result
would be \0F High Intensity Text ! \07.
By choosing different values, the screen attributes can be controlled to
create inverted video, blinking, underlined, and very colorful text.
You can also display the contents of variables by using [\\%Var.name] in
the text block. For instance, if the variable %0 is to be printed, use \\%0
within the text after the BEGTYPE command.
An additional command CLS can be used to clear the display before
printing data. For instance, the combination "BAT CLS BEGTYPE" is quite
useful for printing menus and text such as this screen.
end
goto -scroll
-line604
begtype
\0fNOW IT'S YOUR TURN !!!\07
If the \0f%4\07 variable contains the word \0fDAY\07, what is the command to display
the words "\0fFUN DAY\07" on the display?
end
%A = "TYPE FUN %4" | Call -tryit
-opt7
-line605 %i = 700
-line700 %H = "Reading things from user" | call -header | begtype
In order to get input from the user, there are two available commands,
READ and INKEY.
When the command word READ is seen in the batch file, an input line is
accepted from the user. All function keys are assigned to the normal DOS
edit functions. When ENTER is pressed, the input line is assigned to DOS
variables.
Each word will be assigned in order to the variables indicated after the
READ command. When there are no more variables after the READ command to
assign, the remainder of the response is thrown away. If there are more
variables to be assigned after the READ command than there are words from
the user, these variables will be cleared out to a empty state. For
example:
READ Please enter your name ==> %1 %2
This would prompt the user and wait for him to enter two words. These
words will be saved in the %1 and %2 variables.
end
goto -scroll
-line701 call -header | begtype
Note that there does not have to be any variables indicated after the
command READ. In this case, BAT would wait for the enter key, throw away
any response, then continue to process the next batch file command.
end
goto -scroll
-line702 call -header | begtype
In the event that you wish to get a single keystroke from the user, the
INKEY command should be used.
This command will wait for the user to enter a single key on the keyboard
and return its value in the optional variable. This key can be not only
letters, but all function keys, control keys, etc. For example:
INKEY Press any key to continue... %0
When the user presses a single key, that key is saved into the variable %0.
If the key that is pressed is in the range of "!" to "z" (decimal 33 to
122) then the key saved to the optional variable. If you wish this key to be
echoed to the display, you must specifically use the TYPE command.
end
goto -scroll
-line799 %i = 703
-line703 call -header | begtype
If the key is not in the above range, then the key will be converted to
the form "KEYxxx" where xxx is the hex value of the key. Extended key
codes will be in the range KEY100 to KEY1FF and nonextended key codes will
be in the range KEY000 to KEY0FF. Refer to Appendix G of the Basic manual
for a complete description of the various assignments of key codes.
The character does not have to be assigned to a variable. If the
variable name is not present following the command INKEY, the system will
wait for any key to be pressed from the user, and then continue processing.
end
goto -scroll
-line704
begtype
\0fNOW IT'S YOUR TURN !!!\07
We wish to create a menu with several options. At a "\0f=>\07" prompt,
the user must enter a \0fsingle letter\07 to select his option. What is
the command needed to request a single keystroke into the \0f%4\07
variable for option selection using the prompt above?
end
%A = "INKEY => %4" | call -tryit
-opt8 %i = 800
-line800 %H = "Program Control" | call -header| begtype
There are several ways of controlling the order of execution of a program
written with Extended Batch Language. GOTO, CALL, RETURN, and IF are all
commands that do this. The simplest is the GOTO command:
GOTO -LABEL
If this line is put into a ".BAT" file, then it will stop execution at
this line and resume at the line within the file which contains:
-LABEL
This is a unconditional branch. If the label is not present within the
file, and error will result. Note the minus (-) sign before the label
name. \0FLabels must be preceded with a minus sign.\07 This is done so
that BAT can tell the difference between a label and a command within the
language.
END
goto -scroll
-line801 call -header | begtype
A CALL command is similar to a GOTO command. The primary difference is
that the line where the CALL command was is saved away. Then a branch to a
label is done, just like the GOTO command. Note that the CALL command can
be nested up to 31 levels. When a RETURN command is found, the last line
that was saved is now restored. Execution resumes at the line following
the original CALL command.
END
goto -scroll
-line802 call -header | begtype
For example, if a program contains:
BAT * CALL/RETURN sample..
TYPE "One"
\0FCALL -LABEL\07
\0FCALL -LABEL\07
TYPE "Four"
EXIT
-LABEL
TYPE " Two"
TYPE " Three"
\0FRETURN\07
You will see on the display:
One
Two
Three
Two
Three
Four
end
goto -scroll
-line803 call -header | begtype
The final way to control the flow of an Extended Batch Language program
is to use an IF command. The general form of this command is:
IF _word_ _condition_ _word_ _operation_______
Each word can be a fixed string of letters, or a variable, or a
combination of each.
The conditions can be:
< less than
> greater than
<> not equal to
= equal to (case insensitive)
== exactly equal to (case sensitive)
The operation can be any of the Extended Batch Language commands.
end
goto -scroll
-line899 %i = 804
-line804 call -header | begtype
For example, all of the following IF statements will compare correctly
and execute their corresponding TYPE command. The first two statements
will initialize variables used in the IF commands.
BAT * IF/THEN/ELSE Examples...
%1 = "ABC"
%2 =
IF "ABC" = %1 THEN TYPE The variable contains ABC.
IF %1 = 'abc' THEN TYPE This also matches.
IF 0 <> 00 THEN TYPE These are different lengths.
IF 0 < 00 THEN TYPE 0 has a smaller length.
IF 456 > 123 THEN TYPE Numerically, 456 is bigger.
IF 456 < %1 THEN TYPE ASCII value of 456 is smaller.
IF AABCD = A%1D THEN TYPE String substitutions are made.
IF %2 <> %1 THEN TYPE Variables are different lengths.
IF .%2 = . THEN TYPE This matches if var is empty.
IF BOX = BOX IF DOG <> CAT THEN TYPE Did multi-if compare.
IF 1 + 2 = 3 THEN TYPE Arithmetic results match.
end
goto -scroll
-line805
begtype
\0fNOW IT'S YOUR TURN !!!\07
We wish to make a series of tests on a menu option that a user entered.
It is saved in the variable \0f%4\07. What command is needed to test for
the letter "\0fA\07"?
end
%A = "IF %4 = A" | call -tryit
-opt9 %i = 900
-line900 %H = "KEYBOARD STACK" | call -header| begtype
There is a method within the BAT language for answering questions from
programs without operator intervention. This is done by a "keyboard
stack". By entering data into the stack, you will essentially be entering
data through your keyboard when any program requests it. In this way, a
batch file can now answer questions programs may have by 'typing' them for
the user.
The keyboard stack operates in a "first-in first-out" basis. That is,
the first line of text put into the stack will be the first seen by the
program when it reads the keyboard. The second line entered will be the
second seen by the program, and so on. As long as there is text remaining
on the stack, ALL requests for data from the keyboard will actually come
from the stack. Once the stack has been emptied by the program, data will
then come from the keyboard as usual.
There are two commands which store data into the stack, STACK and
BEGSTACK. Here's some more about them.....
end
goto -scroll
-line901 call -header | begtype
The STACK command is very much like the previously mentioned TYPE
command. Instead of displaying to the screen, it will "push" data into the
keyboard stack area. When any program is ready to accept information from
the keyboard, the parameters after the STACK command will be used as input.
For example:
BAT * This program will issue remarks to DOS.
%1 = HELLO
STACK REM THIS IS A REMARK FOR DOS
STACK REM VARIABLE %%1 = %1
When executed, the following will appear on the screen:
A>REM THIS IS A REMARK FOR DOS
A>REM VARIABLE %1 = HELLO
end
goto -scroll
-line902 call -header | begtype
The second command used to stack data is BEGSTACK. This command is
equivalent to BEGTYPE previously described. It is useful for dumping large
amounts of data to the stack area. Although no parameter substitution is
performed, there are several advantages to its use.
First, if a line ends with the ";" (semicolon) character, a carriage
return will NOT be stacked. Second, if "\\HEX" is used where HEX is a
number from 01 to FE, then this exact keyboard value will be stacked. This
is useful for stacking special control characters and symbols. Third, if
"\\00\\HEX" is used, an extended key code will be stacked. This is useful
for stacking function keys and the like. Refer to the Basic manual in
Appendix G under "Extended Codes". Fourth, if \\FF\\HEX is used, the stack
will delay the keyboard characters from appearing to the program for HEX
number of CPU "ticks". There are about 12 hex (18 decimal) ticks per
second in the CPU. In all cases, the word HEX above represents a two digit
hexadecimal number. Finally, \\\\ can be used to stack a single backslash.
Some examples...
end
goto -scroll
-line903 call -header | begtype
Some examples of BEGSTACK command::
BEGSTACK
\\09 Will stack the tab key.
This text will be stacked ;
on one line!
\\00\\3B Will stack an F1 key.
\\\\ is seen as one backslash.
\\FF\\24 will pause two seconds.
end
Hint: Some programs remove keystrokes before accepting a critical key. In
some cases this can be avoided by using \\FF\\01 in the BEGSTACK command.
end
goto -scroll
-line904 call -header | begtype
Note that in the above examples, the STACK or BEGSTACK commands always are
\0fbefore\07 the command or program that will be using the keystrokes. An
example of this order is:
BEGSTACK
<<keystroke values needed by the program>>
END
<<program that will be controlled by the stack>>
An example of using the stack with the COPY command within DOS would be:
BEGSTACK
This text will be given to the copy command.
\\00\\3B An F1 key ends the copy.
END
COPY CON: result.txt
end
goto -scroll
-line905 call -header | begtype
There are also three control commands which are associated with the stack:
STACK.OFF - Redirects data to come directly from
the physical keyboard. Does not remove
any data in the stack.
STACK.ON - Directs data to come from the stack.
This is the default.
STACK.PURGE - Removes any data from the stack and
keyboard buffers which are pending.
end
goto -scroll
-line999 %i = 906
-line906
begtype
\0fNOW IT'S YOUR TURN !!!\07
From our menu, we wish to start up a communications program and
automatically dial a phone number with a smartmodem. The communications
program we have will take what is typed on the keyboard and send it to the
modem. The command needed for the modem to dial our phone is
"\0fATD12\07" . What Extended Batch Language command will force the
communication program to dial this modem command?
end
%A = "STACK ATD12" | call -tryit
-opt10 %i = 1000
-line1000 %H = "GETTING RESULTS!" | call -header | begtype
The results of programs often need to be known so that some action can
take place after the program ends.
When the command word READSCRN is seen in the batch file, a line of text
is read from the display screen into variables. Having the ability to read
text from the display can be useful for determining the result of another
program, or making a query for some system status which would not normally
be available within a batch file. For example, by reading a directory from
the screen, a series of files can be submitted to the macro assembler.
Once the assembly is completed, the status can be read from the screen to
determine if there were errors which would stop the link step. Virtually
any message which a program can generate can be used as feedback to a batch
file by using READSCRN.
end
goto -scroll
-line1001 call -header | begtype
Its operation is very much like the READ command except for the fact that
the information which is being read is coming from the display screen and
not the keyboard. Like the READ command, the text from the screen is
separated at word boundaries and assigned to variables. The return
code %R will be reflect the line number on the display that was
read. This number will be in the range of 1 to 25 for the top to bottom
lines respectively. Once a line is read, this command will be set to read
the previous line. Repeated READSCRN commands will read UP the display!
For example:
CLS
TYPE HELLO THERE
READSCRN %A %B %C
After execution:
%A contains HELLO
%B contains THERE
%C contains nothing, it is empty.
%R (return code) contains 1, the line number that was read.
end
goto -scroll
-line1099 %i = 1002
-line1002
begtype
\0fNOW IT'S YOUR TURN !!!\07
From our menu, we have started the IBM Macro Assembler program. We know
that when this program ends it will report the number of errors found. We
want to make sure that this number is zero before continuing to the LINK
program. If we save this number in the variable \0f%A\07, what is the
command to read the assembler result from the display?
end
%A = "READSCRN %A" | call -tryit
-opt11 %i = 1100
-line1100 %H = ASSIGNMENTS | call -header| begtype
If the first character in the command is a '%' (Percent sign), then it is
considered to be an assignment statement. The first variable cannot be any
predefined variable (such as %R or %%), but may be any of the other
variables %0 to %9 and %A to %O. If a DOS command is later executed and
uses one of the variables, it will be properly replaced with the
contents of that variable.
The first assignment string, the operator, and the final strings are optional.
The assignment statement must appear in one of the following forms:
\0f[var] = \07- create empty variable
\0f[var] = [string] \07- simple assignment
\0f[var] = [string] & [string] \07- concatenate two strings
\0f[var] = [number] + [number] \07- addition
\0f[var] = [number] - [number] \07- subtraction
\0f[var] = [number] * [number] \07- multiplication
\0f[var] = [number] / [number] \07- division
\0f[var] = [string] # \07- string length
\0f[var] = [string] $ [index] [length] \07- create substring (like MID$ in BASIC)
end
goto -scroll
-line1199 %i = 1101
-line1101 call -header | begtype
\0f[var]\07 - A DOS variable or global user variable %0 to %9 and %A to
%O. It may not be a predefined variable.
\0f[string]\07 - Any valid quoted text. Letters, numbers, any variable, or
any combination there of. "123", 'ABC', and "That's It" are all valid strings.
\0f[number]\07 - Any token with a numeric result in the range of ± 2**64.
For example (if %A contains 34) the three numbers 98, %A, and 12%A5
(equivalent to 12345) would all be valid numbers.
\0f[index]\07 - Same restrictions as [number] above except that an
[index] above 16 is meaningless and is equivalent to the number 16.
\0f[length]\07 - Same restrictions as [number] above except that a
[length] above 15 is meaningless and is equivalent to the number 15. Note
that [length] is optional and has a default value of 15.
end
goto -scroll
-line1102
begtype
\0fNOW IT'S YOUR TURN !!!\07
We wish to count the number of times that a user has used a certain .BAT
program. We will keep this count in the global user variable \0f%A\07
which will stay active even BETWEEN batch file execution. What is the
command needed to increase the value in this variable by one?
end
%A = "%A = %A + 1" | call -tryit
-opt12
-line1103
-line1299 %i = 1200
-line1200 %H = "DEBUGGING AIDS" | call -header| begtype
As an aid in debugging, the TRACE.ON command enables a trace flag which
causes each line in the BAT program to be printed as it is executed. Three
'+' (plus) symbols will precede the BAT statement which is printed out as
an aid. The trace can be turned off at any time by the TRACE.OFF command.
A trace can be active during DOS commands within the BAT program. In
addition, trace can be enabled/disabled at any time, even in immediate
mode. Once enabled, it will remain in effect until the TRACE.OFF command
is executed. Errors, execution of other BAT language files, and even
executing DOS commands will not change the trace mode.
end
goto -scroll
-opt13
-line1201 %i = 1300
-line1300 %H = "External Functions" | call -header| begtype
External functions give Extended Batch Language additional capabilities.
They are programs that add new commands within the EBL language. Within
these external functions are helpful routines in writing complex EBL
programs. Generally, you will be able to write almost all of your EBL
programs without these functions. Occasionally there may be some special
need for a unique operation that is not part of the commands built into
Extended Batch Language. This set of external functions can therefore be
added to EBL as needed.
To use any of these functions, just enter the name of the external function
package from DOS or put the name of the package within your AUTOEXEC.BAT
file. Your batch files can then have any of the additional capabilities
that are contained within the function package.
end
goto -scroll
-line1301 call -header | begtype
\0eProvided to non-commercial users to share and copy:\07
\0fBATFUNC1\07 contains CENTER, CHDIR, DATE, GETDIR, KEYPRESSED, LEFT,
LOWER, LOCATE, RIGHT, STRIP, TIME, UPPER, WHATFUNC
\0eProvided to registered users only:\07
\0fBATFUNC2\07 contains C2H, D2H, H2C, H2D, INT86, PEEK, POKE, REBOOT,
WHATFUNC
\0fBATMATH3\07 contains FLOAT, ABS, FRAC, INT, WHATFUNC
\0fBATALLF\07 contains all of above functions within one package.
\0fBATXV\07 contains Extended Variables. Allows almost unlimited
variable space. Also allows flexible variable
names, indexing, and array capabilities.
Source code to all external functions is also provided to all registered
users.
end
goto -scroll
-line1302 call -header | begtype
A summary of some of the commands provided within BATFUNC1.COM are:
CENTER( string i [pad] ) - Centers a 'string' within an 'i' field
CHDIR( directory ) - Changes sub-directory to 'directory'
DATE() - Returns the system date
GETDIR() - Returns the current subdirectory
KEYPRESSED() - Returns "T" if any key is pressed
LEFT( string i [pad] ) - Left justifies 'string' within 'i' field
LOWER( string ) - Returns 'string' in lower case
LOCATE x y - Move cursor to new position x y
RIGHT( string i [pad] ) - Right justifies 'string' within 'i' field
STRIP( string [type [char]] ) - Removes blanks or 'char' from 'string'
TIME() - Returns the system time
UPPER( string ) - Returns 'string' in upper case
WHATFUNC() - Returns the names of the functions loaded
Complete details of each function, including examples, can be found in the
Extended Batch Language Version 3 Users Guide starting on page 163.
end
goto -scroll
-line1399 %i = 1303
-line1303 call -header | begtype
These functions can be used any place a variable or other values can be used.
For instance, they can be used in an expression:
%A = LEFT( %B 8 )
They can be used in a condition statement:
IF KEYPRESSED() THEN GOTO -HAD.KEY
Or they can be used in combination with each other:
TYPE The hour is now: LEFT( TIME() 2 )
In general, external functions can be very powerful additions to Extended Batch
Language. Registered users receive details of how to add their own custom
additions using external functions. The BAT-BBS will be the repository for all
new functions from other users.
end
goto -scroll
-opt14
-line1304 %i = 1400
-line1400 %H = "Additional Information" | call -header| begtype
The size of the keyboard stack defaults to 1024 bytes. This value can be
changed by making the first statement which is executed by the Extended
Batch Language program be of the form: BAT * size. Size is the decimal
number of bytes to reserve for the stack. This must be executed, for
instance, when a system reset is performed because once this area is
installed, the size is never altered until another system reset.
There are additional variables %A thru %O (oh) which are called "global
user variables". These variables are used exactly like the variables
supplied by DOS (%0 to %9) with two exceptions. First, the contents of
these variables are maintained between execution of batch files for as long
as the system is powered on. This "global" feature is useful for keeping
indicators BETWEEN "sessions" of the user. Second, because DOS does not
know about these variables, they \0fcannot\07 be used as variables within
any DOS command. So while "COPY %1 %2" is valid, "COPY %A %B" is not. If
you wish to use them within DOS commands, they must first be copied via a
statement like "BAT %1 = %A".
end
goto -scroll
-line1401 call -header | begtype
PREDEFINED VARIABLES...
A return code is available at memory address [0000:04FE]. If set by a
program, BAT can read this byte value with the variable %R. The string
stored into this variable is in hex with leading zeros truncated.
The current default drive is stored into the %V variable. It is a single
character.
The status of the stack is stored into the %Q variable. It is a "K" if
the READ command will be reading from the keyboard, and a "S" if it will be
reading from the stack area.
There are two character literals. %S represents a space literal and %%
represents a percent sign. Either of these special variables can be stored
into other variables, or used for testing special cases.
end
goto -scroll
-line1402 call -header | begtype
The STATEOF command will search all disk drives for the existence of a file.
The name after the word STATEOF can be a specific name, general name with
wildcard characters (e.g. *.EXE), or it can be a name with a specific drive
specification (e.g. A:PE.EXE). In the last case, only drive A: will be
searched instead of all available drives. Note also that a variable can be
used instead of a file name. In this version of BAT, only files in the
current directory (no paths) can be found.
The return code variable %R is used to indicate the result of the search
for STATEOF. The results are:
0 - File found on default drive.
1 - File not found.
9 - Invalid file name specified.
A to D - Same as return code 0 but instead of being found on the
default drive, it was found on drive A, B, C, or D.
end
goto -scroll
-line1403 call -header | begtype
If a you wish to put more than one command on a line, the vertical bar
"|" is useful. When used with an IF command and the test for the IF
conditions fail, the entire rest of the line will be ignored. Multiple
commands within a BAT statement is very useful when combined with the IF
command. For example:
IF %A = abc TYPE this | CALL -that | GOTO -other
If a comment is needed within a BAT program, the "*" (star) character is
useful. When used after the word BAT, all characters which follow will be
ignored. For example:
* This is a comment to the programmer.
end
goto -scroll
-line1404 call -header | begtype
That's about all the help there is!
If you still need more information, you might wish to call the BAT-BBS
hotline at 407/395-2816.
Fully registered users will receive a password to the BAT-BBS hot-line to
allow them to get updates, ask questions, and get helpful tips and
examples. You will also receive many EBL extensions including source code,
examples and samples of all kinds. In addition, the manual they receive
gives complete descriptions on all available commands with examples of
each. We feel that user supported software should be a two way street.
With your help, it will work.
If you find this program of value, you may purchase it for $49 at the
address below. For further information, see section 2 of this document.
Seaware Corp. 406/392-2046
Post Office Box 1656 800/634-8188
Delray Beach, FL 33444
end
goto -scroll
-on.error-
%e = %e + 1 | if %e > 2 then %L = ? | skip 6
if %R <> 6 then skip 5
%G = .goto.
color 8f |type Loading part 1 ...
color 07 |type
leave
batdoc
begtype
Unexpected error \%S%R in line \%S%L !
This batch file was error free when it was distributed
by Seaware. An error indicates that it was most likely
modified by someone improperly. To get an updated demo
diskette send $10 to Seaware directly or call 800/634-8188.
Seaware Corp.
Post Office Box 1656
Delray Beach, FL 33444
end
%G =
%E = 0
exit