Dec 052017
An excellent batch file enhancer with many great functions. If you write batch files, then you need this program. | |||
---|---|---|---|
File Name | File Size | Zip Size | Zip Type |
RONSET.DOC | 13586 | 4061 | deflated |
RONSET.EXE | 38556 | 20002 | deflated |
RONSET.NEW | 536 | 243 | deflated |
Download File RONSET14.ZIP Here
Contents of the RONSET.DOC file
RONSET
------
Batch file enhancer
Copyright (C) Ron Bemis 1990
All rights reserved
Version 1.2
TBU is nice, but...
I wanted something better. I couldn't find it, so I wrote it myself. Here
it is - my idea of the ultimate batch file utility. It lets you set
environment variables to whatever you like... with brains. It does what
DOS should have done. This program is the equivalent of the internal DOS
SET command, but it's much more powerful. You can use it just like you use
SET, just don't include the equal sign '='.
Before you read any further, you should be forewarned that this document is
sketchy at best. So what else is new? People that know me have come to
expect that. Think of this as a reference guide. If someone wants to
write real documentation for this program, I'd be more than happy to hear
from you!
By the time you're done playing with this program, you should understand
what the following line does and how it works:
RONSET fname "low(hex(add(mult(65536,string(Net:,5)),string(Node:,5))).REQ)"
At least try each function by itself on the command line to see how they
work. Satisfy yourself that each function does work as you think it
should. I think there's about a zillion things you can do with this
program if you cut loose with the creative juices.
Happy batchin'.
Arithmetic functions
--------------------
All arithmetic is done with 32-bit numbers.
add(addend,addend)
returns the sum of the two values
sub(minuend,subtrahend)
returns the difference of the two values
mult(multiplicand,multiplier)
returns the product of the two values
div(dividend,divisor)
returns the quotient of the two values
eq(x,y)
returns 1 if x is equal to y, 0 otherwise
ne(x,y)
returns 1 if x is not equal to y, 0 otherwise
lt(x,y)
returns 1 if x is less than y, 0 otherwise
le(x,y)
returns 1 if x is less than or equal to y, 0 otherwise
gt(x,y)
returns 1 if x is greater than y, 0 otherwise
ge(x,y)
returns 1 if x is greater than or equal to y, 0 otherwise
Binary functions
----------------
All arithmetic is done with 32-bit unsigned numbers.
and(x,y)
returns the bitwise AND of x and y
or(x,y)
returns the bitwise OR of x and y
xor(x,y)
returns the bitwise XOR of x and y
not(x)
returns the 1's complement of x
hex(x)
returns the 8-digit hexidecimal equivalent of x
String functions
----------------
asc(string)
returns the decimal value of the first ASCII character of string
concat(x,y,z...)
returns a string of concatinated strings
len(string)
returns the length of 'string'
left(size,string)
returns the leftmost 'size' characters of 'string'
mid(loc,size,string)
returns 'size' characters of 'string', starting at 'loc'.
right(size,string)
returns the rightmost 'size' characters of 'string'
low(string)
returns 'string' in lowercase letters
up(string)
returns 'string' in uppercase letters
pos(find,string)
returns the position of substring 'find' in 'string'
if 'find' is not found in 'string', 0 is returned
this search is case sensitive
replace(old,new,string)
returns 'string' with all occurances of 'old' changed to 'new'
Comparing strings
-----------------
eqs(x,y)
returns 1 if x is alphabetically equal to y, 0 otherwise
nes(x,y)
returns 1 if x is alphabetically not equal to y, 0 otherwise
lts(x,y)
returns 1 if x is alphabetically less than y, 0 otherwise
les(x,y)
returns 1 if x is alphabetically less than or equal to y, 0 otherwise
gts(x,y)
returns 1 if x is alphabetically greater than y, 0 otherwise
ges(x,y)
returns 1 if x is alphabetically greater than or equal to y, 0 otherwise
alpha(string)
returns 1 if 'string' is entirely alphabetic characters, 0 otherwise
num(string)
returns 1 if 'string' is entirely numeric characters, 0 otherwise
Getting input
-------------
char(prompt,allowed,seconds)
returns a single character entered from the keyboard
optional 'prompt' will be displayed to the screen
optional 'allowed' restricts input to specified characters
optional 'seconds' sets a timeout for entering a key
if 'seconds' is used, a timer displays on-screen during last 10 seconds
if timeout, user presses enter, esc, or ctrl-C, this returns nothing
string(prompt,maxlength)
returns a string as entered from the keyboard
optional 'prompt' will be displayed to the screen
optional 'maxlength' restricts input to 'maxlength' characters
default 'maxlength' if not specified is 80
Exit errorlevel
---------------
Normally RONSET exits with errorlevel 0. In the event of an error, it will
exit with errorlevel 255 after displaying an error message.
level(value)
exit with errorlevel 'value' immediately
this does an immediate exit and doesn't set any environment variables
the command line environment variable is still required, but not used
Filenames
---------
file(fspec)
returns the base filename and extension of 'fspec'
wildcards are not expanded
no check is made for the file's existance
name(fspec)
returns only the base filename of 'fspec'
wildcards are not expanded
no check is made for the file's existance
ext(fspec)
returns only the extension of 'fspec'
wildcards are not expanded
no check is made for the file's existance
drive(fspec)
returns only the drive letter and ":" of 'fspec'
no check is made for the file's existance
no check is made to see if the drive is valid
path(fspec)
returns only the directory path of 'fspec'
no check is made for the file's existance
no check is made to see if the directory path is valid
full(fspec)
returns the fully-qualified filespec of 'fspec'
wildcards are not expanded
if 'fspec' is not specified, current drive and path are returned
dir(drive)
returns the drive letter, ":" and current directory path of 'drive'
if 'drive' is not specified, current drive is returned
exist(fspec)
returns 1 if 'fpsec' exists, 0 otherwise
wildcards are allowed
expand(fspec)
returns the fully-qualified filespec of 'fspec'
if wildcards exist, they are expanded and the first match is returned
if 'fspec' is not specified, current drive and path are returned
size(fpsec)
returns the size of 'fspec'
if wildcards exist, the size of the first match is returned
fdate(fpsec)
returns the date of 'fspec'
if wildcards exist, the date of the first match is returned
the format is suitable for string comparisons against other file dates
wild(fspec)
returns 1 if 'fspec' contains wildcards, 0 otherwise
Miscellaneous
-------------
echo(string)
displays 'string' to the standard output
returns 'string'
exec(doscommand)
executes 'doscommand' and returns the errorlevel
free(drive)
returns amount of free space on 'drive'
if 'drive' is not specified, current drive is assumed
total(drive)
returns total amount of space on 'drive'
if 'drive' is not specified, current drive is assumed
mem()
returns total amount of free memory
any arguments are ignored
this value does not include the memory used by RONSET
tenv()
returns total environment space
any arguments are ignored
env()
returns amount of free environment space
any arguments are ignored
this value is calculated before RONSET sets its variable
ver(argument)
returns the DOS version number
if 'argument' is "major", the major number is returned (3)
if 'argument' is "minor", the minor number is returned (30)
if 'argument' is "both", both are returned (3.30)
if 'argument' is not specified, "both" is assumed
if(test,true,false)
returns 'false' if the value of 'test' is 0, returns 'true' otherwise
if 'true' is not specified, nothing is returned when 'test' is non-zero
if 'false' is not specified, nothing is returned when 'test' is zero
FidoNet
-------
These functions will probably be worthless to you unless you operate a node
in the FidoNet nodelist. An 'address' may have any of the following forms:
zone:net/node.point (full address)
zone:net/node (point 0 assumed)
net/node.point (same zone assumed)
net/node (same zone, point 0 assumed)
node.point (same zone and net assumed)
node (same zone and net, point 0 assumed)
.point (same zone, net and node assumed)
zone(address)
returns the zone portion of the specified address
net(address)
returns the net portion of the specified address
node(address)
returns the node portion of the specified address
point(address)
returns the point portion of the specified address
lookup(name)
returns the address of the specified name
'name' should be in the format "First Last" (without the quotes)
last name is optional
USERLIST.DOG is searched first if it exists, then FIDOUSER.LST
if BBS is defined, these files must be located there (SET BBS=C:\OPUS)
if BBS is undefined, these files must be in the current directory
most nodelist compilers can generate FIDOUSER.LST for you
each line in the file must be exactly the same length
both files must be sorted alphabetically
Date and time
-------------
The date() and time() functions work identically with one exception: if
there are no arguments, date() uses a default argument of "K, W d, Y", and
time() uses a default argument of "h:0m:0s". If arguments are included,
they are interpretted as follows:
j the julian (actually gregorian) date (1-366)
_j same as above, but space-padded on the left to three characters
0j same as above, but 0-padded on the left to three digits
the capital letter "J" may also be used instead of "j"
K the day of the week, spelled out (Sunday-Saturday)
k the first three letters of the day of the week (Sun-Sat)
x the day of the week, as a number (0-6)
the capital letter "X" may also be used instead of "x"
Y the full 4-digit year
y the last two digits of the year
M the month of the year, as a number (1-12)
_M same as above, but space-padded on the left to two characters
0M same as above, but 0-padded on the left to two digits
W the month of the year, spelled out (January-December)
w the first three letters of the month of the year (Jan-Dec)
d the date of the month (1-31)
_d same as above, but space-padded on the left to two characters
0d same as above, but 0-padded on the left to two digits
the capital letter "D" may also be used instead of "d"
h the hour (0-23 or 1-12) see note below
_h same as above, but space-padded on the left to two characters
0h same as above, but 0-padded on the left to two digits
the capital letter "H" may also be used instead of "h"
Note:
If the am/pm notation is used, the hour will be returned as a
number between 1 and 12. Otherwise, it will be returned as a
number between 0 and 23 (military time). In other words, if you
include an "a", "A", "p", or "P" anywhere in the date() or time()
arguments, you'll get something between 1 and 12. If you don't use
one of these, you'll get something between 0 and 23.
m the minute (0-59)
_m same as above, but space-padded on the left to two characters
0m same as above, but 0-padded on the left to two digits
s seconds (0-59)
_s same as above, but space-padded on the left to two characters
0s same as above, but 0-padded on the left to two digits
the capital letter "S" may also be used instead of "s"
a am/pm notation (am-pm)
any of the letters "A", "p", or "P" may also be used instead of "a"
The use of this argument causes a change in the way the hours are
displayed. See the note above.
"_" and "0" may be used only as prefixes on the arguments indicated above.
If they are used elsewhere in the argument string they are ignored. All
other characters in the argument are copied as-is into the output string.
I hope you'll enjoy this program, and I also hope that you'll consider
sending in a registration if you like it. Please let me know if you find
something that doesn't work like you think it should. Also, please let me
know if you think of any enhancements for this program.
- Ron Bemis, FidoNet 124/1113, 214-213-3841
RONSET is shareware! That means that if you use it on a regular basis, you
must pay for it. You are hereby granted a limited licence to use this
program for a period of one month. At the end of this month, you must
either register this program or discontinue its use. This program may NOT
be used in a business, for-profit organization, or corporate environment
without first being registered. Registration price for this program is $20
per machine. Registrations should be mailed to:
Ron Bemis
9601 Forest Ln #222
Dallas, TX 75243
December 5, 2017
Add comments