Dec 192017
 
Enhance batch files with computer environment testing.

Full Description of File


Batch file utility to read system status


File TSTIF121.ZIP from The Programmer’s Corner in
Category Batch Files
Enhance batch files with computer environment testing.
File Name File Size Zip Size Zip Type
FILE_ID.DIZ 43 43 stored
TESTIF.DOC 9116 2943 deflated
TESTIF.EXE 13112 11981 deflated

Download File TSTIF121.ZIP Here

Contents of the TESTIF.DOC file



Computer Tyme TESTIF * Version 1.21 * Release Date: 11-28-92
Copyright 1989-92 by Marc Perkel * All Rights Reserved

Computer Tyme * 411 North Sherman, Suite 300 * Springfield Mo. 65802
Voice: 417-866-1222 * Modem: 417-866-1665 * Fax: 417-866-0135 * USA

This program is part of a utilities package. Before registering it
you might want to try out some of the other programs in the package.

You can download these other programs from our BBS at 417-866-1665 or
from our section on Compuserve. (GO COMPTYME) If you have any questions
feel free to call us.


Evaluation Version. This program is not registered.
If you want to use it you need to buy a copy.


Price: $20/User, $75/Server, $395/Unlimited

This program tests the system and returns dos error codes that can be used
to control the execution of .BAT files.

Usage: TestIf VideoMode

Example:
TESTIF VideoMode
IF ERRORLEVEL 7 GOTO MONO

This program tests the system and returns dos error codes that can be used
to control the execution of .BAT files. Error codes range from 0 to 255.
Within this program are commands for reading system parameters and processing
them mathematically into useful error codes.

REM This checks to see if selected screen is MONO or COLOR
TESTIF VideoMode
IF ERRORLEVEL 7 GOTO MONO
:COLOR
....
GOTO END
:MONO
....
:END

VideoMode is a Testif command that returns the current video mode. If the
current mode is MONO then VideoMode returns a 7.

With this command, if you have both MONO and COLOR screens on your computer,
and you want to set up a .BAT file to bring up a piece of software that is
installed different for mono and COLOR, Testif makes it easy.

Testif has the capibility to test results to see if a command equals a
value.

TESTIF VideoMode = 7

Returns error code 1 if true and 0 if not true. A 1 is always returned to
indicate TRUE and 0 is returned to indicate FALSE. Operators include
=, [], [, ], [=, ]=. Note the square brackets replace the normal greater
than and less than symbols. That is becuase MS-DOS filters these characters
and therefore can't be used.

TESTIF (Year = 93) and (Month = May)

Testif supports all logical operators such as AND, OR, XOR, NOT. Multiple
conditions can be used. Year returns the year part of the system date. Month
returns the month part. May is a constant equal to 5. The error code result
will be 1 for true or 0 for false.

TESTIF MemSize / 10

MemSize returns the total memory size in K. Since this number is usually
larger than 255, (the maximum error code), we devide by 10. On a 640k
machine, the return code is 64. Notice that division is supported. Testif
supports the mathematical operators +, -, *, /, MOD, SHL, SHR, AND, OR, XOR.
All numbers are processed as signed 32 bit integers. It is up to you to
keep the result between 0 and 255 for meaningful results.

TESTIF 5*(9+3)

Interpretation is from left to right. Parentheses can be used to alter this
order. The above example returns 60.

TESTIF FreeSpace(0) ] 4000000

This checks freespace on the current drive (0). Other drives can also be
checked. The result is 1 if more than 4,000,000 bytes are free.

TESTIF FileSize TESTIF.EXE / 1000

This returns the filesize of TESTIF.EXE in K.

To test your formulas, start the line with an @ sign. Testif will print the
return code on the screen.

TESTIF @DosVersion
Return Code: 3


TESTIF Commands:

SUN Constant = 0
MON Constant = 1
TUE Constant = 2
WED Constant = 3
THU Constant = 4
FRI Constant = 5
SAT Constant = 6

JAN Constant = 1
FEB Constant = 2
MAR Constant = 3
APR Constant = 4
MAY Constant = 5
JUN Constant = 6
JUL Constant = 7
AUG Constant = 8
SEP Constant = 9
OCT Constant = 10
NOV Constant = 11
DEC Constant = 12

MONO Constant = 7
CO80 Constant = 3
BW80 Constant = 2
CO40 Constant = 1
BW40 Constant = 0

VideoMode Returns Current Video Mode
VideoPage Returns Current Video Page
ScreenWidth Returns Current Screen Width
Year Returns System Year (88=1988)
Month Returns System Month
Day Returns System Day
DayOfWeek Returns System Day of week (0=SUN)
Hour Returns System Hour
Minute Returns System Minute
Second Returns System Second
WriteVerify Returns if Write Verify is on
DosVersion Returns Dos Version Number
MinorDosVersion Returns Minor Dos Version Number
CurrentDrive Returns Current Drive Number (A: = 0)
Drives Returns Number of Drives
Floppies Returns Number of Floppy Drives
SerialPorts Returns Number of Serial Ports
ParellelPorts Returns Number of Parralel Ports
CapsLock Tells if Caps Lock is on (1=True)
NumLock Tells if Num Lock is on (0=False)
ScrollLock Tells if Scroll Lock is on
MemSize Returns Total Memory Size in K
Random Returns a Random Number from 0 to 255.
SectorsPerCluster(n) Returns Number of Sectors per Cluster (0=Current Drive)
BytesPerSector(n) Returns Number of Bytes per Sector (1=A:)
FreeClusters(n) Returns Number of Free Clusters (2=B:)
TotalClusters(n) Returns Total Number of Clusters (3=C:)
FreeSpace(n) Returns Free Space in Bytes (4=D:)
TotalSpace(n) Returns Total Space in Bytes
Exist Tells if File Exists
FileSize Returns File Sise in Bytes
FileAttr Returns File Attribute
FileDate Returns Date and Time as 32 bit Number
Mem(A:B) Returns Byte at A:B
MemW(A:B) Returns Word at A:B
Port(A) Returns Byte at Part A

= True if A = B
[] True if A <> B
[ True if A < B
] True if A > B
[= True if A <= B
]= True if A >= B
+ Returns A + B
- Returns A - B
* Returns A * B
/ Returns A / B
MOD Returns A mod B
AND Returns A and B
OR Returns A or B
XOR Returns A xor B
SHL Returns A shl B (Shift Left)
SHR Returns A shr B (Shift Right)
NOT Returns not A

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

Make Check Computer Tyme Order Form
Payable To: 411 North Sherman Suite 300
Springfield Mo. 65802 USA

Voice: (417) 866-1222 * Sales: (800) 548-5353
Fax: (417) 866-0135 * BBS: (417) 866-1665
Compuserve: 71333,427 * GO COMPTYME

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

Company: ________________________________________________

Name: ________________________________________________

Address: ________________________________________________

City/St/Zip: ________________________________________________

Phone: ________________________________________________

PO. Number: ________________________________________________

Got From: ________________________________________________

Comments: ________________________________________________

Comments: ________________________________________________


==> TESTIF * Version 1.21 * Release Date: 11-28-92

==> Price: $20/User, $75/Server, $395/Unlimited


Dos ToolBox: $59.95/User __ MarxMenu: $59.95/User __

Network Survival Kit: (Inc. ToolBox/MarxMenu) $495/Server __

Shipping: Ground: $3 __ 2nd Day: $6 __

1 Day: $15 __ Foreign: $15 __

Credit Card Number: _______________ Expiration Date: ________

Signature: __________________________________________________

Master Card: __ Visa: __ Discover: __

* We do not take American Express *

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


 December 19, 2017  Add comments

Leave a Reply