I F F
A Multifunction BATch File Utility
Version 5.0
By John Knauer, Jr.
CompuServe # 75236,1466
Copyright (C) 1989 by John Knauer,Jr
ALL RIGHTS RESERVED.
June 1989
Table Of Contents
-----------------
Introduction:
Preface Introduction 1
License Introduction 1
Warranty Introduction 2
History Introduction 3
What's New Introduction 3
Syntax Introduction 5
Sub-Options Introduction 5 (also see page 8)
Options Introduction 6
Errorlevel Codes Introduction 6
Options/Commands:
Sub-Options Explained Page 1
rAm Page 2
sCan Page 3
Date Page 4
Exist Page 5
Find Page 6
Input Page 7
Label Page 8
Menu Page 9
Prompt Page 10
Question Page 11
seaRch Page 12
Size Page 13
Test drives Page 14
Wait Page 15
eXpanded Page 16
Order Form Page 17
User Response Form Page 18
Appendix:
Helpful Hints Appendix 1
Commented Demo
BATch Files Appendix 2-18
June 1989
Preface
-------
IFF is a powerful BATch file utility that performs a multitude of
functions, from asking a simple Y/N question and accepting string
input, to checking for formatted disks, as well as EMS memory
installation.
Unlike other smaller utilities, IFF incorporates several utilities
in one package under one name, IFF. IFF uses DOS' ERRORLEVEL BATch
variable to let your BATch file know what IFF has or has not found (for
more information on ERRORLEVEL please check your DOS manual). By
following IFF with a series of
IF ERRORLEVEL ...
commands, you can test the return codes and take appropriate action.
Limited License
---------------
IFF - COPYRIGHT 1989 by John Knauer,Jr
All Rights Reserved.
You are granted a limited license to use, share, copy and
distribute IFF for NONCOMMERCIAL use, provided:
(1) this notice and Copyright information is not removed or
altered,
(2) no fee may be charged for such copying and distribution,
EXCEPT-clubs and user groups distributing the software on a
ShareWare basis providing that the entire IFF package with
accompanying documentation files is included in the
distribution and no more than a nominal fee (not to exceed
$10) is charged for such copying and distribution,
(3) IFF may ONLY be distributed in it's original unmodified
state.
Registration
------------
If you find IFF useful and convenient to use, I encourage you to
register.
PARTIAL registration ($20) includes a diskette of the current
version of IFF and one upgrade to the next major version of IFF.
FULL registration ($25) includes a diskette and pre-printed manual
for the current version of IFF as well as a diskette and pre-printed
manual for the next major version of IFF when it becomes available.
Please state the current version number of the software you are
presently using and send registration to:
John Knauer, Jr.
P.O.Box 747
Brookfield, CT 06804
IFF v5.0 June 1989
Introduction -1-
NOTE: You may not use this product in a commercial environment,
educational institution or government organization without paying a
license fee. Site licenses and commercial distribution licenses are
available. Contact me at the above address for more information.
Site License
------------
This license allows the use of the software within your company,
and is not transferable. This allows internal use and copying of the
software by as many users/machines as you have contracted for. An
unlimited Site License allows unlimited copying of the software for
internal use by your company. Distribution, repackaging, or reselling
of the software to third parties is not allowed.
Distribution License
--------------------
This allows distribution of the software with commercial software
that is manufactured by your company. This license is non-exclusive
and non-transferable.
Warranty
--------
IFF is provided on an as-is basis without warranty of any kind,
expressed or implied.
John Knauer,Jr. makes no warranties, expressed or implied,
including, but not limited to, merchantability or fitness for any
particular purpose. In no event shall John Knauer,Jr. be liable for
direct, indirect or consequential damages arising from the use of this
software program.
If you fail to abide by the terms of this license -
"May The Ostrich Of Paradise Drop An Egg On The Hood Of Your
New Mercedes"
IFF is a supported utility that has grown, and will continue to
grow, with the help of your support.
The documentation is in alphabetic order and the Appendix contains
sample BATch files for your easy reference. These files are included
as individual demonstration BATch files to help you get started.
Thanks again to Mike Todd of The Source, Dr. File Finder of
The Black Bag, and Gary Snider of Rocky Road for their help and
support. And to Brigid, for all her patience and understanding while
I've written this software.
ENJOY!
IFF v5.0 June 1989
Introduction -2-
HISTORY
===========
v1.00 Jan.86 Checked for file on specified drive (option E).
Asked a Y/N question (option Q).
v2.00 Feb.86 Added the Menu option (option M),
seaRch option (option R),
Check for disk space (option S).
v2.01 Mar.86 Added the 2 option to the E option.
v3.00 Apr.87 Added a chime to all requests for response.
sCan option. Prompt option.
Allowed 0-Z for Menu and Prompt options.
Removed the 2 option from the E option. IFF
now will report 99 and 89 on all options with
disk access.
Re-wrote and condensed various routines.
v4.00 Apr.88 eXpanded memory option.
rAm memory test option.
Date option. Label option.
Beep to all error messages.
Buffered keyboard, a response can be typed
before you're presented with the prompt.
Can not Crtl.Break out of IFF.
WHAT'S NEW
==========
v5.00 Jun.89 Date option now automatically updates IFF without
needing to tell IFF where to find itself(Under
DOS 3.x).
Find option, same as sCan, but does not change the
default directory.
Input option allows strings to be put in the
DOS Environment variable named IFF.
(** NOT IN MULTI-TASKING ENVIRONMENTS **)
Test drives option lists ALL available drives
in the DOS Environment variable IFF.
Wait option and sub-option.
SUB-OPTIONS:
Calendar Day, Default responses, Month, No error
messages, Pause # of seconds between chimes,
Seconds, use DOS enVironment, Wait then continue
and Z "Sleep/Quiet" - do not chime.
No longer writes directly to the screen.
IFF v5.0 June 1989
Introduction -3-
NOTES
=====
New with version 5.0 are "sub-options". They allow more flex-
ibility without the need for a configuration program. If you add a
sub-option to an option that does not utilize that sub-option, it will
simply be ignored. Also note, the Input option and enVironment sub-
option WILL NOT WORK IN MOST multi-tasking environments.
When testing IFF's results, you should test for the highest
possible return code first, i.e. check for 99 then 89 etc. You can put
in a 'blanket' IF statement to catch any error by using
IF ERRORLEVEL 60 GOTO [your error handler]
this will catch any result greater than 60.
Always remember IF ERRORLEVEL nn ..... will catch the ERRORLEVEL
greater than or equal to nn. Please consult your DOS reference manual
for more information.
Lastly, the latest version of IFF will always be available on The
Black Bag, and Rocky Road. I can be contacted for problems, questions
and comments at the above address, CompuServe (75235,1466), or the
above BBS's.
Files you should have received:
IFF.EXE The actual IFF program
IFF.DOC This documentation
IFF_?.BAT Several demonstration BATch files to help
you get started
READ????.??? Last minute notes
ORDER.FRM An order form
RESPONSE.FRM User response form
IFF v5.0 June 1989
Introduction -4-
Syntax
------
IFF
Options Sub-options Parameters ------- ----------- ---------- A - rAm n AMOUNT C - sCan n d: filename.ext D - Date cmn d:\path\IFF.EXE E - Exist n d:\path\filename.ext F - Find n d: filename.ext I - Input np#w##z VARIABLE LENGTH L - Label n d: LABEL M - Menu d#nvp#w##z d:\path\filename.ext LIMIT P - Prompt d#nvp#w##z LIMIT Q - Question d#nvp#w##z TEXT R - seaRch n d:\path\filename.ext S - Size n d: AMOUNT T - Test drives nv -none W - Wait nsw## MINUTES X - eXpanded n PAGES ?/space-blank gives online reference Example ------- IFF Pd4p1vw30 4 This translates - IFF prompt option; default to "4"; change the pause between the chimes to 1 second intervals; store the result in the DOS environment variable IFF; wait 30 seconds, if no response, continue on. Set the parameter LIMIT to 4, ie., only accept inputs of 0,1,2,3 or 4. Sub-Option Definitions ---------------------- c - calendar day -none- d - default response #(response) m - month -none- n - no error msgs. -none- p - pause/chime # of seconds[default 4] s - seconds not min. -none- v - environment -none- w - wait then cont. ## of seconds z - sleep/quiet -none- IFF v5.0 June 1989 Introduction -5- Option Definitions ------------------ d: Disk Drive. \path\ Pathname (if applicable). filename.ext The name of the file to which the option applies (Wild Cards are NOT allowed). TEXT Single line of text to be displayed on the screen. AMOUNT Number of K your testing for. MINUTES Number of minutes to wait. LABEL Disk volume label being tested. V.LENGTH Length of string variable you want. LIMIT Keyboard input limit (default 3). PAGES Number of 16k EMS pages being tested. Errorlevel Codes ---------------- 99 Disk Drive door open 89 Disk is not Formatted 79 Not enough room(Disk,RAM,Environment) 69 Parameter invalid 68 Sub-option error 59 Wait time-out 20 NO or File not found or Wrong Date 1-10 Search's return code (See Text) 0-35 Menu & Prompt responses 10-35 Drive test # 1-31 Calendar Day 1-12 Months 1-7 Sunday - Saturday 0 YES or All went well Possible Errorlevel Codes ------------------------- rAm 79,69,68,0 sCan 99,89,69,68,20,0 Date 99,89,69,68,20,1-7,1-12,1-31 Exist 99,89,69,68,20,0 Find 99,89,69,68,20,0 Input 79,69,68,0 Label 99,89,69,68,20,0 Menu 99,89,69,68,59,0-35 Prompt 69,68,59,0-35 Question 69,68,59,20,0 seaRch 99,89,69,68,20,1-10 Size 99,89,79,69,68,0 Test drive 79,69,68,10-35 Wait 69,68,59,0 eXpanded 79,69,68,0 IFF v5.0 June 1989 Introduction -6- Sub-Options Explained --------------------- New with IFF v5.0 are sub-options that allow you to "customize" your user-interface. Here is a brief description of what they do: The d sub-option takes a 1 character parameter and allows you to show a default response. If the user pressed this character is used as their input. Example: IFF Pd0 4 would cause IFF to prompt you with: Your Choice? 4 The n sub-option simply tells IFF that you don't want it to display any of it's messages. Example: IFF Pd0n 4 The p sub-option allows you to alter how often IFF chimes the user for input. The default is every 4 seconds. In the above example, we want to chime every second, so: IFF Pd0p1 4 You can specify up to a 9 second delay. The v sub-option allows you to store a response in DOS' Environ- ment. IFF creates a variable named IFF in the Master Environment. Please note this does not work in Multi-tasking environments. When you use this sub-option, IFF still returns an errorlevel based on the response. The w sub-option causes IFF to "Time-Out" while waiting for input. This is useful for un-attended operation. Simply specify how many seconds to wait before continuing, from 01-99. Note, you must give a 2 digit number. Lastly the z sub-option. This simply tells IFF that you don't want it to chime. For the c and m sub-options, please see the Date option. For the s sub-option, please see the Wait option. IFF v5.0 June 1989 Introduction -7- IFF An AMOUNT -------------- Possible Errorlevel Codes: 79,69,68,0. The rAm option allows you to test the amount of usable RAM in your system. IFF finds the actual amount of available RAM, not the total amount installed. This allows you to check if a system has enough memory for an application. rAm sets DOS' ERRORLEVEL BATch variable to 79 if there is not enough RAM, or 0 if the available RAM is equal to or greater than AMOUNT. Example: -------- To test for 384K: IFF A 384 IFF will respond with Want: 384 Have: nnn where nnn is the available amount of RAM. If nnn is equal to or greater than 384, ERRORLEVEL will be set to 0. NOTE: YOU MUST USE THE 'K' AMOUNT. If you didn't want IFF to display "Want... Have...." and use any of it's error messages, add the n sub-option, IFF An 384 IFF v5.0 June 1989 Page 1 IFF Cn d: filename.ext ------------------------ Possible Errorlevel Codes: 99,89,69,68,20,0. The sCan option allows you to search the specified drive for the existence of filename.ext. Unlike the E option, discussed later, the C option will search the whole drive, through ALL subdirectories. If the file is found, IFF will change the default drive and subdirectory to where the file was found. sCan sets DOS' ERRORLEVEL BATch variable to 99 if the drive door is open, 89 if the disk is not formatted, 20 if the file was not found, or 0 with the default drive and subdirectory changed to where the file was found. Example: -------- if you were logged onto drive A:, and you invoke IFF with: IFF C C: procomm.exe and IFF finds procomm.exe on drive C: then IFF will change the logged drive to c: and the default subdirectory of drive C: to the subdirectory where procomm.exe was found. If you did not want IFF to display any of it's error messages, you would add the n sub-option to you command: IFF Cn c: procomm.exe IFF v5.0 June 1989 Page 2 IFF Dcmn d:\path\IFF.EXE ------------------------ Possible Errorlevel Codes: 99,89,69,68,20,1-7,1-12,1-31. The Date option is used to ensure that the DOS System Date has been set at least to the date stored in IFF (6-05-89 on initial use). This can be a very useful function to run in systems where date sensitive entries are made. This ensures that the operator has not bypassed or reset the System Date to an earlier date. You could have the BATch file run a program that delivers a message that the operator does not see or whatever other operation you deem necessary. There are several ways to use this option. First, with the command: IFF D if your System Date is less than the date stored in IFF, ERRORLEVEL will be set to 20. If the System Date is equal to or greater than the date stored in IFF, ERRORLEVEL will be set to the number of the day of the week (1-Sunday, 2-Monday, etc.). Next, if your system date is greater than the date stored in IFF and the second parameter points to the IFF.EXE file such as: IFF D C:\UTILITY\IFF.EXE |----------------| (not needed under DOS 3.x) then the date in IFF will be updated so that the next time you run IFF it will check against this more current date. Again, ERRORLEVEL will be set to the number of the day of the week. If the IFF.EXE file is not found, then ERRORLEVEL will be set to 69. If you have no second parameter on the command line, and the system date is greater than the date stored in IFF, IFF will not be updated (unless you are using DOS 3.x). Note: To find out what date IFF has stored internally, simply type DIR IFF.EXE. When IFF updates it's date, the date DOS stores in the directory, is changed. New with version 5.0 are the sub-options c and m . When added to the D options they will report the calendar date, or the month. To find out what the date is, you would use: IFF Dc this will report an ERRORLEVEL of 1-31. If you needed to know what month it was, use: IFF Dm to suppress IFF's error messages, also add the sub-option n : IFF Dn or IFF Dcn or IFF Dmn. IFF v5.0 June 1989 Page 3 IFF En d:\path\filename.ext --------------------------- Possible Errorlevel Codes: 99,89,69,68,20,0. The Exist option tests for the existence of the specified file. Unlike DOS' EXIST BATch file command, if the disk drive door is open, or the disk is not formatted, you won't get the 'Abort,Retry or Ignore' error message from DOS. Exist sets DOS' ERRORLEVEL BATch variable to 99 if the drive door is open, 89 if the disk needs to be formatted, 20 if the file was not found, or 0 if the file was found. To suppress IFF's error messages add the n sub-option. Example: ------- If you wanted to test for the existence of a file named PROGRAM.BAT in the subdirectory named \BATCH on drive D:, you would use the following command: IFF E D:\BATCH\PROGRAM.BAT OR if no error messages are wanted: IFF En D:\BATCH\PROGRAM.BAT IFF v5.0 June 1989 Page 4 IFF Fn d: filename.ext ------------------------ Possible Errorlevel Codes: 99,89,69,68,20,0. The Find option allows you to search the specified drive for the existence of filename.ext. Unlike the C option, discussed earlier,the F option will search the whole drive, through ALL subdirectories, BUT if the file is found, IFF will NOT change the default drive and sub- directory to where the file was found. This is useful if you just want to know if a file is on the drive. Find sets DOS' ERRORLEVEL BATch variable to 99 if the drive door is open, 89 if the disk needs is not formatted, 20 if the file was not found, or 0 it was found. Example: ------- IFF F c: procomm.exe and IFF finds procomm.exe on drive C: it simply returns 0 in DOS' ERRORLEVEL to let you know it was found. If you did not want IFF to display any of it's error messages, you would add the n sub-option to you command: IFF Fn c: procomm.exe IFF v5.0 June 1989 Page 5 IFF Inp#w##z VARIABLE LENGTH ----------------------------- Possible Errorlevel Codes: 79,69,68,0. The Input option allows you to receive a string input of VARIABLE LENGTH and store it in the DOS Environment. The string is stored in a variable named IFF. Example: ------- IFF I 6 This would cause IFF to present you with: Input ? [ ] ^^^^^^ < 6 spaces This information would then be stored in the environment variable IFF. To use this information you would use this command in your BATch file: IF %IFF%== Note:THIS OPTION DOES NOT WORK IN A MULTI-TASKING ENVIRONMENT. IFF v5.0 June 1989 Page 6 IFF Ln d: LABEL --------------- Possible Errorlevel Codes: 99,89,69,68,20,0. The Label option tests for LABEL as the volume label of drive d:. If IFF finds a volume label on drive d: and it matches LABEL, IFF will set ERRORLEVEL to 0. If there is no match, then ERRORLEVEL is set to 20. ERRORLEVEL will be set to 99 if the drive door is open, 89 if the disk is not formatted, or 69 if there is a parameter error. Example: ------- If you wanted to test for BACKUP_UTLS as the volume label on drive A: you would use the following command: IFF L A: BACKUP_UTLS If you wanted to see if a disk had any label, use the following IFF L A: note that here we didn't specify a volume label. This can be used to ensure that all your disks are labeled. If a blank volume label was found, you could invoke a volume labeling program. If no error messages are desired, add the n sub-option, ie. IFF Ln A: BACKUP_UTLS IFF v5.0 June 1989 Page 7 IFF Md#np#vw##z d:\path\filename.ext LIMIT ------------------------------------------ Possible Errorlevel Codes: 99,89,69,68,59,0-35. This is an 'extension' of the Question option, discussed later, that allows for more than a YES or NO response. Filename is a text file you create in the form of a menu with up to 36 options listed. If the LIMIT option is not selected, then IFF will only accept a response of 0-3, but with LIMIT set as Z, IFF will allow 0-Z! The response key is as follows: LIMIT - 0 1 2 3 4 5 6 7 8 9 A B C D E F G H I J K L Errorlevel - 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 M N O P Q R S T U V W X Y Z 22 23 24 25 26 27 28 29 30 31 32 33 34 35 IFF will set DOS' ERRORLEVEL BATch variable to your response, ie., a response of 1 will set ERRORLEVEL to 1 etc. If the specified text file can not be found, IFF will set ERRORLEVEL to 69. Example: ------- C:\MENU.FIL contains --> : This is a test menu : Start your favorite program : Your options are: : : 1 - Your Spreadsheet : 2 - Your Database : 3 - Your Word Processor : : : 0 - End When you invoke IFF by --> : IFF M C:\MENU.FIL with default limit of 3 : : This is a test menu IFF will print the text : Start your favorite program file and prompt you with : Your options are: "Your Choice ?" --> : : 1 - Your Spreadsheet : 2 - Your Database : 3 - Your Word Processor : : : 0 - End : : Your Choice? Use the n sub-option to suppress error messages. Only your specified or the default response range will be accepted. The prompt will remain on the screen until the correct response is received. IFF v5.0 June 1989 Page 8 IFF Pd#np#vw##z LIMIT --------------------- Possible Errorlevel Codes: 69,68,59,0-35. The Prompt option allows you to create a menu within the working BATch file. This option allows you the flexibility to prompt a user for more than 2 options on your menu without having to create a separate file to be loaded and printed as with the Menu option. The LIMIT is the limit on keyboard response. If you only want 0-2 allowed, you would specify 2: IFF P 2, IFF would then only accept 0,1 or 2 for a response. To allow for letters, you would invoke IFF with: IFF P E, IFF will then allow 0-9,A,B,C,D or E for a response. Please Note: If you do not specify LIMIT, IFF will default to 3 (0,1,2 or 3). See the Menu option for the key of responses. Example: ------- ECHO OFF CLS ECHO .SAMPLE BATCH FILE USING THE PROMPT OPTION ECHO . ECHO .1 - YOUR SPREADSHEET ECHO .2 - YOUR DATABASE . . . . . . ECHO .B - YOUR COMMUNICATIONS ECHO .0 - TO END IFF P B . . IFF will only allow 0-9, A & B. The advantage of Prompt is you don't need a separate "menu" file, but if you want to easily change the look of the menu you should use the Menu option. IFF v5.0 June 1989 Page 9 IFF Qd#np#v2##z TEXT -------------------- Possible Errorlevel Codes: 69,68,59,20,0. Question simply prompts you for a Y(es) or N(o) response. The text can be any question, up to 80 characters long, that can be answered with a Y or N. IFF sets DOS' ERRORLEVEL BATch variable to 20 when the response is N(o) and to 0 with a Y(es) response. Only Y,y,N or n is accepted. The prompt remains on the screen until either the Y or N key is pressed. ECHO off will suppress the printing of the command line and will display the TEXT along with the Y(es) or N(o) ? prompt. Example: ------- IFF Q Do you wish to continue DISPLAYS: Do you wish to continue Y or N ? IFF v5.0 June 1989 Page 10 IFF Rn d:\path\filename.ext --------------------------- Possible Errorlevel Codes: 99,89,69,68,20,1-10. Search is an extension of Exist. With Search, you create a text file containing up to ten (10) filenames, that you wish to test for their existence. seaRch sets DOS' ERRORLEVEL BATch variable to 99 if the drive door is open, 89 if the disk is not formatted, 20 if the text file was empty or no files were found, or 1-10 based on the position within the text file that the file was found. Example: ------- Filename -------- C:\FILE.LST contains --> : C:\STARTUP.BAT : B:\SETUP1.BAT : A:\MACRO.COM : D:\MP.COM : D:\MENU.BAT : : When you invoke IFF with --> : IFF R C:\FILE.LST IFF will test for the existence of each filename listed in C:\FILE.LST until it finds a match. IFF will set ERRORLEVEL to the position code of the file it found. If C:\STARTUP.BAT is found, the return code will be 1. If A:\MACRO.COM is found first (the first 2 were not), then the return code will be 3, and so on. IFF v5.0 June 1989 Page 11 IFF Sn d: AMOUNT ---------------- Possible Errorlevel Codes: 99,89,79,69,68,0. Size allows you to test the amount of available space on the specified drive, AND it also lets you test to see if a disk in the drive is formatted! IFF sets DOS' ERRORLEVEL BATch variable to 99 if the drive door is open, 89 if the disk is not formatted, 79 if there is not enough room [see note!!], based on the AMOUNT you specify or 0 if there is enough room. *NOTE: An empty formatted floppy disk, formatted under DOS 2.x or later [not the high capacity AT disks] DOES NOT really contain 360k of space. The actual size is 354k. PLEASE use only the 'K' amount. For example; 12,288 is 12k, 262,144 is 256k not 262k. If you need 512,485 you can test with 501, just to be sure. Example: ------- If you wanted to test the disk in drive C: for 128k of free space, from within your BATch file, you would include the line: IFF S C: 128 IFF will respond Wanted: 128 Have:nnn where nnn is the amount of space left on the drive. This can also be use to test for a valid drive. By using the command: IFF S d: 0 IFF will report 'Not enough space' for an invalid drive. Use the n sub-option to suppress all messages from IFF. IFF v5.0 June 1989 Page 12 IFF Tnv ------- Possible Errorlevel Codes: 79,69,68,10-35. Test drives check what disk drives are available on your system. If you specify the v sub-option, all active drive letters will be stored in DOS' Environment in the variable IFF. If you don't use that sub-option, IFF sets DOS' errorlevel to the response code (see Menu) of the last valid drive found. Example: ------- IFF Tv and you have active drives A: - F: This will check for all drives and set the environment variable IFF to: A B C D E F and errorlevel to 15. If drive D: did not respond, the variable would look like this: A B C E F Use the n sub-option to suppress all messages from IFF. IFF v5.0 June 1989 Page 13 IFF Wnsw## MINUTES ------------------- Possible Errorlevel Codes: 69,68,59,0. Wait does simply that, wait. MINUTES specifies how many minutes you want to wait before continuing with your BATch file. If you use the s sub-option, then MINUTES becomes SECONDS. Example: ------- IFF W 4 IFF would wait 4 minutes or until someone pressed any key to continue. IFF Ws 4 IFF would wait only 4 seconds or until someone pressed any key to continue. Use the n sub-option to suppress error messages. IFF v5.0 June 1989 Page 14 IFF Xn PAGES ------------ The eXpanded option tests for 1 - if EMS memory is installed, and 2 - if there are PAGES available. You specify the number of 16k EMS PAGES you want to test for. IFF sets DOS' ERRORLEVEL BATch variable to 79 if there are not enough PAGES, 20 if no EMS memory is installed and 0 if enough was found. Example: ------- If you wanted to test for 3 pages (48k) of EMS memory you would use: IFF x 3 IFF will respond Wanted:3 Have:nnn where nnn is the number of available EMS pages. Use the n sub-option to suppress all messages from IFF. IFF v5.0 June 1989 Page 15 ORDER FORM ---------- TO: John Knauer, Jr. Date:___/___/___ P.O. Box 747 Brookfield, CT 06804 FROM: Name:_____________________________ Company:_____________________________ Address:_____________________________ City/State:________________________ Zip:_________ Phone #:(____)____-________ # of Copies ------ _____ Partial - disk + 1 free major upgrade . X 20.00 = ______ _____ Full - disk & printed manual + 1 free major upgrade............ X 25.00 = ______ _____ # of copies x 2.00 for shipping.................= ______ (No overseas orders please) ====== Sub-total.......................................= ______ Connecticut residents, please add sales tax ....= ______ (Sub-total * applicable rate) ====== Total Enclosed..... ______ [ ] Check Enclosed [ ] Money Order Enclosed (NO C.O.D.'S) (A 5.25" diskette will be sent unless otherwise specified!) (Please allow 15 days for checks to clear.) (Please DO NOT send cashe.) IFF v5.0 June 1989 Page 16 USER RESPONSE FORM ------------------ I am interested in knowing more about you, the user. This information helps channel my efforts in the directions you want. Please help me by completing the following questionnaire and mailing it to: John Knauer, Jr. P.O. Box 747 Brookfield, CT 06804 Thank You. 1. Where did you hear about IFF? ___________________________ 2. System being used to run IFF: Computer brand/model __________________________________ Amount of computer memory _____________________________ Operating system ______________________________________ 3. How are you using IFF? __________________________________ _______________________________________________________ 4. ___ Registered user ___ Non-registered user (If you are a non-registered user, why?) _________________________________________________________ 5. If you find a bug in IFF, an error in the manual, or you have a suggestion, I'd like to hear from you. Write your comments here: _________________________________________________________ _________________________________________________________ _________________________________________________________ _________________________________________________________ _________________________________________________________ 6. Name and address (optional): ____________________________ ____________________________ ____________________________ IFF v5.0 June 1989 Page 17 Helpful Hints ------------- Here are some methods of using ERRORLEVEL. First, the "long" method. Here we simple follow IFF with a series of 'IF ERRORLEVEL do something' statements. Remember, start with the greatest possible value. Example: IFF P 9 IF ERRORLEVEL 9 GOTO RES9 IF ERRORLEVEL 8 GOTO RES8 IF ERRORLEVEL 7 GOTO RES7 IF ERRORLEVEL 6 GOTO RES6 IF ERRORLEVEL 5 GOTO RES5 IF ERRORLEVEL 4 GOTO RES4 IF ERRORLEVEL 3 GOTO RES3 IF ERRORLEVEL 2 GOTO RES2 IF ERRORLEVEL 1 GOTO RES1 GOTO END Another method is to use DOS' "FOR" BATch command. This is much "shorter" and easier to code. This method requires you to set up an environment variable, and to test the ERRORLEVEL codes from LEAST to GREATEST. In this example, your labels would be: OPT1, OPT2...OPT9. Example: SET ION= IFF P 9 FOR %%E IN (0 1 2 3 4 5 6 7 8 9) DO IF ERRORLEVEL==%%E SET ION=%%E GOTO OPT%ION% The last method is to use IFF's environment sub-option. This is the easiest of all, but does not work properly in a multi-tasking system. Again in this example your labels would be : OPT0, OPT1...OPT9. Example: IFF Pv 9 GOTO OPT%IFF% IFF v5.0 June 1989 Appendix -1- The balance of the Appendix has been removed for this book edition. Please consult the individual BATch file demos for more information.