Dec 242017
 
VIDTYPE is a utility that detects the type of video adaptor, row and column mode, and system that you are using and automatically sets up DOS environment variables or an errorlevel.
File VIDTYP14.ZIP from The Programmer’s Corner in
Category Display Utilities
VIDTYPE is a utility that detects the type of video adaptor, row and column mode, and system that you are using and automatically sets up DOS environment variables or an errorlevel.
File Name File Size Zip Size Zip Type
ORDER.FRM 916 291 deflated
VIDTYP14.DOC 20822 4977 deflated
VIDTYPE.EXE 41206 18909 deflated

Download File VIDTYP14.ZIP Here

Contents of the VIDTYP14.DOC file




VIDTYPE Ver 1.4 Copyright 1990 by SERVITEK SOFTWARE.
________________ All rights reserved. Revised 02-05-90.


If you find this useful, a $5 contribution would be appreciated.
Please send it to: CHANGE OF ADDRESS!

NEW ADDRESS: (OLD ADDRESS: )
SERVITEK SOFTWARE (Vince Deegan )
PO BOX 280581 (PO BOX 180114 )
Dallas, TX 75228-9181 (Dallas, TX 75218)

Thank you

For local area networks, refer to ORDER.FRM on liscensing fee.


VIDTYPE is a utility that detects the type of video adaptor, row
and column mode, and system (IBM PC/XT/AT/PS2) that you are using
and automatically sets up DOS environment variables or an
errorlevel that represents the description of those equipment
types. This should work with %100 clones, also. In a DOS batch
file, a DOS environment variable can be examined when using the
IF statement with the % symbol at each end of the variable. An
errorlevel can be checked when using the IF and ERRLORLEVEL
statements.

One good use of VIDTYPE is when you want to run applications that
give you a selection of video-driver-files or set-files and you
want to have the necessary video-driver-file or set-file chosen
automatically before calling the application. In other words, you
can write a batch file that uses the DOS-batch-language IF
statement and either the % symbol or ERRORLEVEL statement to
examine the DOS environment variable and/or errorlevel created by
VIDTYPE. Then, depending on which IF statement is true, the batch
file can copy the needed video-driver-file or set-file to the
default driver-file or set-file used by the application.

In some cases, using a DOS variable can interfere with some DOS
operations that depend on the use of the DOS environment space.
If this ever occurs with you, you can choose to refrain from
using DOS variables and, instead, use an errorlevel to detect the
type of equipment being used.

Make this choice carefully, though, since the advantage to using
a DOS variable as opposed to an errorlevel is that it only needs
to be set once and VIDTYPE only needs to be called once at the
start-up of your system, within the autoexec.bat file. The
errorlevel needs to be checked immediately after VIDTYPE is
executed requiring VIDTYPE to be called in each batch file that
determines a video-driver-file or set-file for an application.
That's not all that bad, but remember also, when using an
errorlevel, your batch files can become pretty lengthy if you are
going to test for all of the possible choices of equipment.

The use of DOS variables allows you ways of writing smaller and
more clever batch files. So my suggestion would be always to
choose the use of a DOS variable unless you have problems with
your DOS environment space, such as when using very large batch
files whose pointers are kept in the DOS environment space or
when using hardware that isn't hardware-compatible with IBM.


Format: VIDTYPE [-V] [+E] [+S] [+SYS] [+P] [Variable name] [Debug]

OR VIDTYPE NP > PRN
(Prints help with no pause)

-V : This option tells the program not to use DOS variables.
(The default setting is for DOS variables to be used.)

+E : This option tells the program to set an errorlevel.

+S : This option will cause VIDTYPE to assign a shorter
description to the DOS variable (shown in the chart
displayed in the on-line help).

Variable name : This is the user-defined name that will be used
for the video DOS variable if the -V option
isn't used. When a video DOS variable is used,
row and column DOS variables will automatically
be created in addition to the video variable.

+SYS : This option tells the program to include the system
variable with its system description.

+P : This option tells the program to prompt the user when a
CGA adaptor is detected in order to find out whether a
multi-color monitor or single-color monitor is hooked
up.


========================== SOME EXAMPLES ==========================

-----------------------
VIDEO-ADAPTOR DETECTION:
-----------------------

Say you want to call Lotus 123 where the default set-file is
called 123.SET and your set-file for using a CGA video adaptor is
called CGACOLOR.SET . . .


--------------------------------------------------
EXAMPLE for using a DOS variable for video adaptor:
--------------------------------------------------

- Insert a line in your autoexec.bat file which calls VIDTYPE
in order to set up a DOS environment variable that holds a
description of the video type:

VIDTYPE VIDEO

VIDTYPE will create a DOS environment variable called
VIDEO and give it a string value that describes the type
of video adaptor your system is using, according to the
VIDTYPE chart. (Get a printout of the chart by typing
VIDTYPE NP > PRN.) It will also create two other DOS
variables called ROW and COL that give the current number
of rows and columns being used, respectively.


- Now you can write another batch file to use for calling Lotus
123.

Example: IF %VIDEO% == CGACOLOR COPY CGACOLOR.SET 123.SET
IF %VIDEO% . . . . . . .
IF %VIDEO% . . . . . . .
123

This calls Lotus 123 after copying the needed set-file to
the default set-file.

OR if your application can be called along with the name
of the desired set-file (or driver-file) you can be more
clever in your batch file.

Example: 123 %VIDEO%

This calls Lotus 123 and tells it to use the string value
in the VIDEO variable as the actual set-file name to be
used. I.e. If VIDEO has the string value CGACOLOR, Lotus,
which assumes that the file name has .SET as its
extension, will use CGACOLOR.SET as its set-file.

NOTE: If the +S option was used, the string would have
been CGA instead of CGACOLOR. This could let the variable
serve as a prefix to a file-name. I.e. If you had a
set-file called CGA123.SET, you could type 123 %VIDEO%123
which would be translated as 123 CGA123.SET.

NOTE: If you need to know the current row and column mode
that the system is using, just access the ROW and COL
variables in the same way you accessed the VIDEO variable;
i.e. IF %ROW% == . . . .
IF %COL% == . . . .


NOTE: I have found that if you are using one of the many DOS
shell programs available, you may encounter a problem when
running a batch file that tries to access the DOS variables,
while in the DOS shell program. It may not recognize these
variables as part of the "current" DOS environment since the
variables are in the "master" environment. This problem can be
solved by not running the batch file while in the DOS shell
program. Just run it out in plain ole DOS (the "master"
environment). Also, I am currently working on a way to
overcome that problem and, if successful, will include the
remedy in one of the future versions.

NOTE: The % symbol or the ERRORLEVEL statement, when used with
the IF statement, will not work right when used directly at the
DOS prompt. You must use them in a batch file.


----------------------------------------------------
EXAMPLE for using an errorlevel and no DOS variables:
----------------------------------------------------

- You can write a batch file to use for calling Lotus 123 where
VIDTYPE is called earlier in the same batch file instead of
in your autoexec.bat file:

VIDTYPE -V +E

- VIDTYPE will abstain from using DOS variables and will
create an errlorlevel value that describes the type of
video adaptor and row/col mode your system is using,
according to the VIDTYPE chart. (Get a printout of the
chart by typing VIDTYPE NP > PRN.)

- Then, the remaining lines in your batch file could look
like this:

IF NOT ERRORLEVEL 3 GOTO 2
COPY CGACOLOR.SET 123.SET
GOTO GO
:2
IF NOT ERRORLEVEL 2 GOTO 1
COPY . . . . .
GOTO GO
:1
IF NOT ERRORLEVEL 1 GOTO GO
COPY . . . . .
:GO
123

- This calls Lotus 123 after copying the needed set-file to
the default set-file.

- OR if your application can be called along with the name of
the desired set-file (or driver-file) your batch file could
look like this:

IF NOT ERRORLEVEL 3 GOTO 2
123 CGACOLOR
GOTO END
:2
IF NOT ERRORLEVEL 2 GOTO 1
123 . . . .
GOTO END
:1
IF NOT ERRORLEVEL 1 GOTO END
123 . . . .
:END

- This calls Lotus 123 after testing the errorlevel and tells
it to use the actual set-file name to be used. So, if
ERRORLEVEL is 3, then, according to the VIDTYPE chart, the
video equipment being used is CGA color. Lotus, which
assumes that the file name has .SET as its extension, will
use CGACOLOR.SET as its set-file.

NOTE: If the row/col mode is anything other than the standard
25 by 80 mode, the ERRORLEVELs will be different for each of
the above video types. Please refer to the VIDTYPE chart.

NOTE: On testing errorlevels in a batch file, test in
descending order from highest to lowest and when one is
found, avoid testing the rest of the IF ERRORLEVEL statements
because they, too, will be found to be true. The reason for

this is that when an errorlevel is set in DOS, what is
actually being reported, is that the errorlevel value is the
highest errorlevel to be found. So all ERRORLEVEL values
lower than that will be true, also. Therefore, be prepared to
use the GOTO statement a lot when testing a series of
errorlevels.


----------------
SYSTEM DETECTION:
----------------

------------------------------------------------
EXAMPLE for using a DOS variable for system type:
------------------------------------------------

- Insert a line in your autoexec.bat file which calls VIDTYPE
in order to set up a DOS environment variable that holds a
description of the system type:

VIDTYPE +SYS

VIDTYPE will create a pre-designated DOS environment
variable called SYSTEM and give it a string value that
describes the type of system you are using, according to
the VIDTYPE chart. (Get a printout of the chart by typing
VIDTYPE NP > PRN.)

----------------------------------------------------------
EXAMPLE for using an errorlevel for system type and no DOS
variables:
----------------------------------------------------------

- You can write a batch file where VIDTYPE is called just
before calling your application in order to detect the system
type.

VIDTYPE -V +SYS +E

- VIDTYPE will abstain from using DOS variables and will
create an errlorlevel value that describes the type of
system you are using, according to the VIDTYPE chart. (Get
a printout of the chart by typing VIDTYPE NP > PRN.)

-------------------------------------------
PROMPTED MONITOR DETECTION FOR CGA ADAPTORS:
-------------------------------------------

Since there is no known way of detecting the actual type of
monitor hooked up to your adaptor, multi-color monitors and
single-color monitors are not automatically distinguished. So
the need for user prompting is evident when the monitor type
needs to be known. Currently, the program only prompts for CGA
adaptor detection.

One use, is when you have a CGA adaptor that fails to produce
legible text on a single-color monitor and you need to call
MODE BW80 for black and white mode. In that situation, do the
following:

1. When you are prompted, respond with an "S", showing that
you have a single-color monitor.

2. Any time later, when accessing the video variable, it
will show that you have a single-color monitor.

3. With this information, your batch file can call MODE
BW80 and set the system to black and white mode.


--------------------------------------------------------------
EXAMPLE for using a DOS variable for video type with prompting:
--------------------------------------------------------------

- Insert a line in your autoexec.bat file which calls VIDTYPE
in order to set up a DOS environment variable that holds a
description of the video type and to prompt the user whenever
a CGA adaptor is detected:

VIDTYPE VIDEO +P

VIDTYPE will create a DOS environment variable called
VIDEO and give it a string value that describes the type
of video adaptor your system is using, according to the
VIDTYPE chart. (Get a printout of the chart by typing
VIDTYPE NP > PRN.) It will also create two other DOS
variables called ROW and COL that give the current number
of rows and columns being used, respectively. If a CGA
adaptor is detected, it will prompt the user to give the
monitor type that is hooked up to the adaptor: i.e.

(M)ULTI COLOR MONITOR
(S)INGLE COLOR MONITOR

WHICH TYPE OF MONITOR DO YOU HAVE? >

and will set the variable accordingly. Refer to the
VIDTYPE chart.

---------------------------------------------------------
EXAMPLE for using an errorlevel with prompting and no DOS
variables:
---------------------------------------------------------

- You can write a batch file to use for calling Lotus 123 where
VIDTYPE is called earlier in the same batch file instead of
in your autoexec.bat file:

VIDTYPE -V +P +E

- VIDTYPE will abstain from using DOS variables and will
create an errlorlevel value that describes the type of
video adaptor and row/col mode your system is using,
according to the VIDTYPE chart. (Get a printout of the
chart by typing VIDTYPE NP > PRN.) If a CGA adaptor is
detected, it will prompt the user to give the monitor type
that is hooked up to the adaptor: i.e.

(M)ULTI COLOR MONITOR
(S)INGLE COLOR MONITOR

WHICH TYPE OF MONITOR DO YOU HAVE? >

and will set the errorlevel accordingly. Refer to the
VIDTYPE chart.


--------------------------------
COMBINATIONS OF ANY OF THE ABOVE:
--------------------------------

--------
EXAMPLES:
--------

VIDTYPE VIDEO +S +P Creates a video DOS variable
and gives a shortened
description string to it. And
if it detects a CGA adaptor,
it will prompt the user for
the monitor type. Two other
variables, ROW and COL, will
be created, too, with their
row and column values.

VIDTYPE VIDEO +SYS Creates a video DOS variable
giving the standard long
description string to it. It
also creates the variable,
SYSTEM, with a description of
the type system being used.

VIDTYPE +SYS Only creates the DOS variable,
SYSTEM, with a description of
the type system being used.

VIDTYPE -V +E Turns off the use of DOS
variables and sets an
errorlevel instead, for the
video type, row and col mode,
and system type being used.

VIDTYPE -V +E +P Turns off the use of DOS
variables, sets an errorlevel,
and if a CGA adaptor is
detected, it promts the user
for the monitor type. user


===================================================================

There are some applications that contain automatic video and
system detection for their own use, but since many applications
don't have this capability, VIDTYPE becomes a very desirable
utility, especially in a network environment that has different
types of video equipment on its PC workstations.

To get more how-to details, VIDTYPE will display some information
of its own. Just type VIDTYPE (without any parameters).

Thanks for using VIDTYPE,
Vince Deegan, SERVITEK SOFTWARE

========================= VERSION HISTORY =========================

Version 1.0
- Had the ability to set the DOS variable and the option of
displaying debugging information with the optional DEBUG
parameter.

Version 1.1
- Added the ability to set a DOS errorlevel and two more
parameter options: +E and -V for turning on the errorlevel
mechanism and for turning off the DOS variable mechanism,
respectively. This addition was from the suggestion of Cris
Moore.

Version 1.2
- Added the ability to opt for a shorter string length to the
description assigned to the DOS variable; the +S option.
Corrected a bug in detection of Hercules cards.

Version 1.3
- Correction on use with autoexec.bat files, where error messages
occured, displaying that batch file information was lost.

Version 1.4
- Added options for detecting the current row/col mode, the
system type, and user-prompt for monitor type with CGA
adaptors.


 December 24, 2017  Add comments

Leave a Reply