home *** CD-ROM | disk | FTP | other *** search
-
- RONSET
- ------
-
- Batch file enhancer
- Copyright (C) Ron Bemis 1990
- All rights reserved
- Version 2.3
-
-
- I use DOS environment variables extensively, and I wanted a better way to
- set and use them. 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.
-
- 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-231-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
-
-
- Happy batchin'!
-
-
- 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(concat(hex(string(Net:,5)),hex(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.
-
- The above illustrates how you can "nest" RONSET commands to execute a number
- of them at the same time and with respect to the same environment variable.
- But we're gettin' ahead of ourselves, here.
-
-
- COMMAND SYNTAX:
-
- RONSET variable_name=function(parameters)
-
- In which:
-
- variable_name is replaced by the name of the environment variable you
- want to create or replace;
-
- function is any one of the many functions listed in this
- documentation;
-
- (parameters) are additional commands you give to RONSET. These commands
- are dependent upon the function you have asked for.
-
- All function parameters MUST be enclosed entirely within parenthesis as
- shown above. In this documentaiton, the word "parameter" refers to whatever
- it is you're enclosing within the parenthesis.
-
- Some other ways to use RONSET:
-
- RONSET variable_name= will clear the specified environment
- variable (i.e. remove it from the
- environment).
-
- RONSET function(parameters) will execute the function specified,
- but not set an environment variable.
-
-
- Arithmetic functions
- --------------------
- All arithmetic is done with floating point numbers.
-
- add(addend,addend)
- returns the sum of the two values
- Example: Result:
- RonSet Sum=add(15,32) SUM=47
-
- sub(minuend,subtrahend)
- returns the difference of the two values
- Example: Result:
- RonSet Diff=sub(19,25) DIFF=-6
-
- mult(multiplicand,multiplier)
- returns the product of the two values
- Example: Result:
- RonSet Prod=mult(15,32) PROD=480
-
- div(dividend,divisor)
- returns the quotient of the two values
- Example: Result:
- RonSet Quot=div(100,7) QUOT=14.2857
-
- eq(x,y)
- returns 1 if x is equal to y, 0 otherwise
- Example: Result:
- RonSet X=eq(5,6) X=0
- RonSet X=eq(5,5) X=1
-
- ne(x,y)
- returns 1 if x is not equal to y, 0 otherwise
- Example: Result:
- RonSet X=ne(5,6) X=1
- RonSet X=ne(5,5) X=0
-
- lt(x,y)
- returns 1 if x is less than y, 0 otherwise
- Example: Result:
- RonSet X=lt(5,6) X=1
- RonSet X=lt(5,5) X=0
- RonSet X=lt(6,5) X=0
-
- le(x,y)
- returns 1 if x is less than or equal to y, 0 otherwise
- Example: Result:
- RonSet X=le(5,6) X=1
- RonSet X=le(5,5) X=1
- RonSet X=le(6,5) X=0
-
- gt(x,y)
- returns 1 if x is greater than y, 0 otherwise
- Example: Result:
- RonSet X=gt(5,6) X=0
- RonSet X=gt(5,5) X=0
- RonSet X=gt(6,5) X=1
-
- ge(x,y)
- returns 1 if x is greater than or equal to y, 0 otherwise
- Example: Result:
- RonSet X=ge(5,6) X=0
- RonSet X=ge(5,5) X=1
- RonSet X=ge(6,5) X=1
-
- abs(x)
- returns the absolute value of x
- Example: Result:
- RonSet X=abs(-5) X=5
- RonSet X=abs(10) X=10
- RonSet X=abs(-2.3) X=2.3
-
- mod(x,y)
- returns x modulo y
- Example: Result:
- RonSet Rmn=mod(15,4) RMN=3
- RonSet Rmn=mod(20,4) RMN=0
- RonSet Rmn=mod(17,13) RMN=4
-
- neg(x)
- returns negative x
- Example: Result:
- RonSet Neg=neg(15) NEG=-15
- RonSet Neg=neg(-7.3) NEG=7.3
-
- sqr(x)
- returns x squared
- Example: Result:
- RonSet Big=sqr(83) BIG=6889
- RonSet Big=sqr(-100) BIG=10000
- RonSet Big=sqr(23.5) BIG=552.25
-
- sqrt(x)
- returns the square root of x
- Example: Result:
- RonSet Root=sqrt(9) ROOT=3
- RonSet Root=sqrt(8.7) ROOT=2.94958
-
- pow(x,y)
- returns x to the y power
- this one is an exception to the rules about errorlevels
- if invalid values are specified, a different type of error message (one
- from the floating point run-time library) is displayed, and the program
- may abort with an errorlevel other than 255.
- Example: Result:
- RonSet OneK=pow(2,10) ONEK=1024
- RonSet Big=pow(7,5) BIG=16807
-
-
- Binary functions
- ----------------
- All binary functions are done with 16-bit unsigned numbers.
-
- and(x,y)
- returns the bitwise AND of x and y
- Example: Result:
- RonSet X=and(14,7) X=6
-
- or(x,y)
- returns the bitwise OR of x and y
- Example: Result:
- RonSet X=or(14,7) X=15
-
- xor(x,y)
- returns the bitwise XOR of x and y
- Example: Result:
- RonSet X=xor(14,7) X=9
-
- not(x)
- returns the 1's complement of x
- Example: Result:
- RonSet X=not(14) X=65521
-
- hex(x)
- returns the 4-digit hexidecimal equivalent of x
- Example: Result:
- RonSet X=hex(124) X=007C
- RonSet X=hex(1113) X=0459
-
- oct(x)
- returns the 6-digit octal equivalent of x
- Example: Result:
- RonSet O=oct(29127) O=070707
- RonSet O=oct(4096) O=010000
-
- bin(x)
- returns the 16-digit binary equivalent of x
- Example: Result:
- RonSet B=oct(29127) B=0111000111000111
- RonSet B=oct(4096) B=0001000000000000
-
-
- String functions
- ----------------
-
- asc(string)
- returns the decimal value of the first ASCII character of string
- Example: Result:
- RonSet A=asc(ABCDE) A=65
- RonSet A=asc(XYZ) A=88
- RonSet A=asc(z) A=122
-
- chr(value)
- returns an ASCII character specified by 'value'
- Example: Result:
- RonSet A=chr(65) A=A
- RonSet A=chr(88) A=X
- RonSet A=chr(122) A=z
-
- concat(x,y,z...)
- returns a string of concatinated strings
- Example: Result:
- RonSet X=concat(One, ,Two, ,Three) X=One Two Three
- RonSet X=concat(hex(124),hex(1113)) STR=007C0459
-
- This last example shows one of RONSET's most powerful functions -
- embedded functions. Functions can be embedded as deeply as you
- want, you're limited only by DOS's command line length.
-
- To determine the order that RONSET will evaluate an expression,
- start at the left side and look towards the right until you see a
- right parenthesis ')'. This is the closing parenthesis of the
- first function that will be evaluated. After the evaluation is
- done, it gets put into the expression and the expression is
- re-evaluated from the beginning. This continues until all
- functions have been evaluated.
-
- The last example above is evaluated in this order:
-
- concat(hex(124),hex(1113))
- -------^
- concat(007C,hex(1113))
- --------^
- concat(007C,0459)
- ----------------^
- 007C0459
-
- It sometimes gets a little messy with all those parenthesis, but if
- you miss one or get too many, the error message given by the
- program should be quite helpful in finding the problem. The
- message displayed will show the part of the line that caused the
- problem, with all earlier parts evaluated.
-
- In many cases, the concat() function is not needed. The first
- example above:
-
- RonSet X=concat(One, ,Two, ,Three)
-
- could just as easily have been written as:
-
- RonSet X=One Two Three
-
- But the second example:
-
- RonSet X=concat(hex(124),hex(1113))
-
- could not have been written without the concat() function because
- of the order of evaluation. If you do this:
-
- RonSet X=hex(124)hex(1113)
-
- RONSET will evaluate this expression to "007Chex(1113)" and will
- give you an error message about an unknown function named
- "007Chex".
-
- len(string)
- returns the length of 'string'
- Example: Result:
- RonSet L=len(Hi There!) L=9
-
- left(size,string)
- returns the leftmost 'size' characters of 'string'
- Example: Result:
- RonSet L=left(4,Hi There!) L=Hi T
-
- mid(loc,size,string)
- returns 'size' characters of 'string', starting at 'loc'.
- Example: Result:
- RonSet M=mid(4,3,Hi There!) M=The
-
- right(size,string)
- returns the rightmost 'size' characters of 'string'
- Example: Result:
- RonSet R=right(4,Hi There!) R=ere!
-
- low(string)
- returns 'string' in lowercase letters
- Example: Result:
- RonSet Small=low(Hi There!) SMALL=hi there!
-
- up(string)
- returns 'string' in uppercase letters
- Example: Result:
- RonSet Big=up(Hi There!) BIG=HI THERE!
-
- 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
- Example: Result:
- RonSet X=pos(The,Hi There!) X=4
- RonSet X=pos(Hi T,Hi There!) X=1
- RonSet X=pos(ere!,Hi There!) X=6
-
- replace(old,new,string)
- returns 'string' with all occurances of 'old' changed to 'new'
- Example: Result:
- RonSet X=replace(123,xxx,212311233) X=2xxx1xxx3
-
-
- Comparing strings
- -----------------
-
- eqs(x,y)
- returns 1 if x is alphabetically equal to y, 0 otherwise
- Example: Result:
- RonSet X=eqs(A,B) X=0
- RonSet X=eqs(A,A) X=1
-
- nes(x,y)
- returns 1 if x is alphabetically not equal to y, 0 otherwise
- Example: Result:
- RonSet X=nes(A,B) X=1
- RonSet X=nes(A,A) X=0
-
- lts(x,y)
- returns 1 if x is alphabetically less than y, 0 otherwise
- Example: Result:
- RonSet X=lts(A,B) X=1
- RonSet X=lts(A,A) X=0
- RonSet X=lts(B,A) X=0
-
- les(x,y)
- returns 1 if x is alphabetically less than or equal to y, 0 otherwise
- Example: Result:
- RonSet X=les(A,B) X=1
- RonSet X=les(A,A) X=1
- RonSet X=les(B,A) X=0
-
- gts(x,y)
- returns 1 if x is alphabetically greater than y, 0 otherwise
- Example: Result:
- RonSet X=gts(A,B) X=0
- RonSet X=gts(A,A) X=0
- RonSet X=gts(B,A) X=1
-
- ges(x,y)
- returns 1 if x is alphabetically greater than or equal to y, 0 otherwise
- Example: Result:
- RonSet X=ges(A,B) X=0
- RonSet X=ges(A,A) X=1
- RonSet X=ges(B,A) X=1
-
- alpha(string)
- returns 1 if 'string' is entirely alphabetic characters, 0 otherwise
- Example: Result:
- RonSet X=alpha(abc123xyz) X=0
- RonSet X=alpha(abcXYZABC) X=1
-
- num(string)
- returns 1 if 'string' is entirely numeric characters, 0 otherwise
- Example: Result:
- RonSet X=num(abc123xyz) X=0
- RonSet X=num(123987) X=1
-
- number(string)
- returns 1 if 'string' is a number, 0 otherwise
- just like num(), except this one allows '-', '+', and '.'
- Example: Result:
- RonSet X=number(abc123xyz) X=0
- RonSet X=number(123987) X=1
- RonSet X=number(-123.987) X=1
-
-
- 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 or user presses enter, esc, or ctrl-C, this returns nothing
- Example: Result:
- RonSet X=char() X=char pressed
- RonSet X=char(What?) X=char pressed, with prompt
- RonSet X=char(,XYZ) X=char pressed, XYZ only allowed
- RonSet X=char(,,5) X=char pressed
- X=nothing if timer expires
- RonSet X=char(Really?,YyNn,5) X=char pressed, YyNn only allowed
- X=nothing if timer expires
-
- 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
- Example: Result:
- RonSet X=string() X=user's input, up to 80 chars
- RonSet X=string(Your name:) X=user's input, with prompt
- RonSet X=string(Really?,1) X=user's input, up to 1 char
-
-
- 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
- Example: Result:
- RonSet X=string(Your name:) X=Ron Bemis
- RonSet X=level(len(%X%)) errorlevel 9 (X unchanged)
- If Not Errorlevel 1 Goto NoName
-
- This example is meant to be taken as a batch file fragment rather
- than as separate examples. It illustrates the fact that if you use
- the level() function, the variable specified to the left of the
- equal sign is not effected. Note that the %X% notation only works
- in batch files, not from the command line.
-
-
- Filenames
- ---------
-
- file(fspec)
- returns the base filename and extension of 'fspec'
- wildcards are not expanded
- no check is made for the file's existance
- Example: Result:
- RonSet F=file(c:\dos\command.com) F=command.com
- RonSet F=file(E:\UTIL\*.BAT) F=*.BAT
-
- name(fspec)
- returns only the base filename of 'fspec'
- wildcards are not expanded
- no check is made for the file's existance
- Example: Result:
- RonSet F=name(c:\dos\command.com) F=command
- RonSet F=name(E:\UTIL\*.BAT) F=*
-
- ext(fspec)
- returns only the extension of 'fspec'
- wildcards are not expanded
- no check is made for the file's existance
- Example: Result:
- RonSet F=ext(c:\dos\command.com) F=.com
- RonSet F=ext(E:\UTIL\*.BAT) F=.BAT
- RonSet F=ext(c:\test) F= (not set)
-
- 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
- Example: Result:
- RonSet F=drive(c:\dos\command.com) F=c:
- RonSet F=drive(E:\UTIL\*.BAT) F=E:
-
- 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
- Example: Result:
- RonSet F=path(c:\dos\command.com) F=\dos\
- RonSet F=path(E:\UTIL\*.BAT) F=\UTIL\
-
- full(fspec)
- returns the fully-qualified filespec of 'fspec'
- wildcards are not expanded
- current drive and path are used if 'fspec' does not contain them
- if 'fspec' is not specified, current drive and path are returned
- Example: Result:
- RonSet F=full(command.com) F=D:\MY\CURDIR\COMMAND.COM
- RonSet F=full(E:*.BAT) F=E:\CURDIR\ON_DR_E\*.BAT
- RonSet F=full() F=D:\MY\CURDIR\
-
- dir(drive)
- returns the drive letter, ":" and current directory path of 'drive'
- if 'drive' is not specified, current drive is used
- Example: Result:
- RonSet F=dir() F=D:\MY\CURDIR\
- RonSet F=dir(D) F=D:\MY\CURDIR\
- RonSet F=dir(E) F=E:\CURDIR\ON_DR_E\
-
- exist(fspec)
- returns 1 if 'fpsec' exists, 0 otherwise
- wildcards are allowed
- Example: Result:
- RonSet X=exist(C:\AUTOEXEC.BAT) X=1
- RonSet X=exist(C:\GONE\MISSING.*) X=0
-
- matches(fspec)
- returns the number of files that match 'fspec'
- wildcards are (obviously) allowed
- Example: Result:
- RonSet X=matches(*.EXE) X=5
- RonSet X=matches(C:\DOS\*.*) X=48
-
- expand(fspec,number)
- returns the 'number'th fully-qualified filespec matching 'fspec'
- wildcards are (obviously) allowed
- if 'number' is not specified the first match is returned
- if no parameters are specified, the current drive and path are returned
- Example: Result:
- Ronset X=expand() X=D:\BINKLEY\
- RonSet X=expand(command.com) X=C:\DOS\COMMAND.COM
- RonSet X=expand(C:\*.BAT) X=C:\AUTOEXEC.BAT
- RonSet X=expand(C:\WORK\*.OBJ) X=C:\WORK\MYPROG.OBJ
- RonSet X=expand(C:\WORK\*.OBJ,2) X=C:\WORK\MYPROG2.OBJ
-
- size(fpsec)
- returns the size of 'fspec'
- wildcards are not allowed
- Example: Result:
- RonSet S=size(C:\AUTOEXEC.BAT) S=3289
-
- 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
- Example: Result:
- RonSet S=fdate(C:\AUTOEXEC.BAT) S=1990-02-06 14:56:26
-
- wild(fspec)
- returns 1 if 'fspec' contains wildcards, 0 otherwise
- Example: Result:
- RonSet W=wild(C:*.c) W=1
- RonSet W=wild(D:\utils\myprog.c) W=0
-
- diff(fspec1,fspec2)
- returns 0 if files are identical
- returns 1 if 'fspec1' is missing
- returns 2 if 'fspec2' is missing
- returns 3 if files are different
- Example:
- RonSet D=diff(test.old,test.new)
-
- lines(fspec)
- returns the number of lines in 'fspec'
- wildcards are not allowed
- 'fspec' should be a text file
- Example: Result:
- RonSet S=lines(C:\CONFIG.SYS) S=12
-
- read(fspec,number)
- returns the 'number'th line in 'fspec'
- if 'number' is not specified the first line is returned
- wildcards are not allowed
- 'fspec' should be a text file
- Example: Result:
- RonSet L=read(C:\CONFIG.SYS) L=BREAK=ON
- RonSet L=read(C:\AUTOEXEC.BAT,84) L=Set BBS=D:\BINK
-
- write(fspec,line)
- writes 'line' at the end of 'fspec'
- if 'fspec' does not exist, it is created
- wildcards are not allowed
- returns 'line'
- 'fspec' should be a text file
- Example:
- RonSet L=write(TEST.BAT,@ECHO OFF)
- RonSet L=write(TEST.BAT,DATE date(M/d/y))
-
- attr(fspec)
- returns the attributes of 'fspec'
- return value is created by ORing these bit values together:
- bit 0 0x01 Read-only
- bit 1 0x02 Hidden
- bit 2 0x04 System
- bit 4 0x10 Directory
- bit 5 0x20 Archive
- Example: Result:
- RonSet A=attr(C:\AUTOEXEC.BAT) A=32 (archive)
- RonSet A=attr(C:\OS2KRNL) A=7 (system,hidden,read-only)
- RonSet A=attr(C:\DOS) A=16 (directory)
-
- label(drive)
- returns the volume label of 'drive'
- if 'drive' is not specified, current drive is used
- Example: Result:
- RonSet L=label() L=MYDISK#1.
-
- batch(fspec)
- executes the contents of 'fspec' as individual RONSET commands
- returns nothing
- wildcards are not allowed
- nesting is not allowed
- Example:
- RonSet batch(MARY.RON)
-
- This command functions a little like the level() command. After
- the batch file has been executed, RONSET will exit, and other
- parameters are ignored. For example, the following two commands
- function identically:
- RonSet batch(concat(MARY,.,RON))
- RonSet X=left batch(MARY.RON) right
- In the second command, "left" and "right" are ignored, and X will
- not be changed.
-
-
- Peeking into files
- ------------------
- The byte(), word(), and long() functions all return unsigned numbers.
-
- byte(location,filespec)
- returns a byte (8 bits) at 'location' in 'filespec'
- 'location' is relative to zero (i.e. the first byte is at location 0)
- Example: Result:
- RonSet B=byte(2,C:\autoexec.bat) B=99 'c' of @Echo Off
-
- word(location,filespec)
- returns a word (16 bits) at 'location' in 'filespec'
- 'location' is relative to zero (i.e. the first word is at location 0)
- Example: Result:
- RonSet W=word(0,C:\UTIL\RONSET.EXE) W=23117 'MZ' on every .EXE
-
- long(location,filespec)
- returns a longword (32 bits) at 'location' in 'filespec'
- 'location' is relative to zero (i.e. the first longword is at location 0)
- Example:
- RonSet L=long(8192,NODELIST.IDX)
-
- line(location,filespec)
- returns a string from 'location' in 'filespec'
- 'location' is relative to zero (i.e. the first longword is at location 0)
- Example: Result:
- RonSet Z=asciiz(6,C:\autoexec.bat) Z=Off of @Echo Off
-
-
- Sound
- -----
-
- sound(len,tone...)
- 'len' specifies the length in milliseconds for each tone to play
- 'tone' is the frequency of the tone to play
- returns a null string
- missing tones are "held" tones (i.e. two commas together)
- a 'tone' of 0 is silence
- Example: Result:
- RonSet X=Sound(500,440,,880) Plays middle C for 1 second
- and high C for 1/2 second
- RonSet X=Sound(200,440,440,440) Plays middle C 3 times
- RonSet X=Sound(1000) Delay for 1 second
-
-
- Miscellaneous
- -------------
-
- echo(string)
- displays 'string' to the standard output
- returns 'string'
- Example: Result:
- RonSet JBrown=echo(I feel good!) JBROWN=I feel good! (with output)
-
- exec(doscommand)
- executes 'doscommand' and returns the errorlevel
- Example: Result:
- RonSet X=exec(PkUnZip) X=10 (no parameters)
- RonSet X=exec(command /c dir) X=0
-
- trans(variable)
- returns the contents of the environment 'variable'
- mainly for use in RONSET batch() input files
- this function works much like DOS's %variable% notation
- Example: Result:
- RonSet C=trans(COMSPEC) C=I:\COMMAND.COM
- RonSet B=trans(bbs) B=D:\BINK
-
- free(drive)
- returns amount of free space on 'drive'
- if 'drive' is not specified, current drive is assumed
- Example: Result:
- RonSet F=free() F=12959744
- RonSet F=free(c) F=12969744
- RonSet F=free(d) F=23943168
-
- used(drive)
- returns amount of used space on 'drive'
- if 'drive' is not specified, current drive is assumed
- Example: Result:
- RonSet U=used() F=20494336
- RonSet U=used(d) F=9510912
-
- total(drive)
- returns total amount of space on 'drive'
- if 'drive' is not specified, current drive is assumed
- Example: Result:
- RonSet S=total() F=33454080
- RonSet S=total(d) F=33454080
-
- tenv()
- returns total environment space
- any parameters are ignored
- Example: Result:
- RonSet T=tenv() T=1024
-
- env()
- returns amount of free environment space
- any parameters are ignored
- this value is calculated before RONSET sets its variable
- Example: Result:
- RonSet T=env() T=263
-
- ver(type)
- returns the DOS version number
- if 'type' is "major", the major number is returned (3)
- if 'type' is "minor", the minor number is returned (30)
- if 'type' is "both", both are returned (3.30)
- if 'type' is not specified, "both" is assumed
- Example: Result:
- RonSet V=ver() V=3.30 (DOS 3.3)
- RonSet V=ver() V=10.10 (OS/2 V1.1)
- RonSet V=ver(major) V=3 (DOS 3.X)
- RonSet V=ver(minor) V=10 (DOS X.1)
- RonSet V=ver(both) V=2.11 (DOS 2.11)
-
- 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
- Example: Result:
- RonSet M=if(lt(ver(major),9),D,R) M=D (DOS version < 9.0)
- M=R (OS/2 real mode)
- RonSet Prompt=concat($P,if(lt(ver(major),9),*$G,$G))
- PROMPT=$P*$G (DOS version < 9.0)
- PROMPT=$P$G (OS/2 real mode)
-
- It's important to remember the order that expressions are evaluated
- when using this function. Both 'true' and 'false' are evaluated
- before the 'if' function is evaluated. This function is useful for
- returning a value based on a test, not for conditional execution.
- For example, this won't work:
-
- if(0,exec(command /c delete *.bat),echo(No!))
-
- because both the exec() and the echo() functions will be executed
- before the if() function is.
-
- prn(lpt)
- returns printer status - created by ORing these bit values together:
- bit 0 0x01 Timed out
- bit 3 0x08 I/O error
- bit 4 0x10 Selected
- bit 5 0x20 Out of paper
- bit 6 0x40 Acknowledge
- bit 7 0x80 Not busy
- if 'lpt' is not specified, 1 is assumed (LPT1)
- Example: Result:
- RonSet P=prn(1) P=144 (0x90 - online)
- P=8 (0x08 - offline)
- P=200 (0xC8 - printer off)
-
- rand(max)
- returns a random number in the range 0 to 'max'-1
- Example:
- RonSet X=rand(5) X=0,1,2,3 or 4
-
- info()
- displays information about this version of RONSET
- returns the RONSET version number string
- Example: Result:
- RonSet X=info() X=V2.3
-
- comm(port)
- returns comm port status - created by ORing these bit values together:
- bit 0 0x0001 Change in clear to send (CTS)
- bit 1 0x0002 Change in data set read (DSR)
- bit 2 0x0004 Trailing edge ring detector
- bit 3 0x0008 Change in receive line signal detector (DCD)
- bit 4 0x0010 Clear to send (CTS)
- bit 5 0x0020 Data set ready (DSR)
- bit 6 0x0040 Ring indicator
- bit 7 0x0080 Received line signal detect (DCD)
- bit 8 0x0100 Data ready
- bit 9 0x0200 Overrun error
- bit 10 0x0400 Parity error
- bit 11 0x0800 Framing error
- bit 12 0x1000 Break detect
- bit 13 0x2000 Transmit holding register empty
- bit 14 0x4000 Transmit shift register empty
- bit 15 0x8000 Time out
- if 'port' is not specified, 1 is assumed (COM1)
- Example: Result:
- RonSet P=comm(1) P=24880 (0x6130)
- tx shift/holding empty
- data ready
- DSR/CTS on
-
- color(value)
- sets the monitor display colors
- returns nothing
- if 'value' is not specified, 7 is assumed (gray on black)
- type the sample COLOR.LST for values
- hint: after setting a color, use the DOS CLS command to fill screen
- Example: Result:
- RonSet X=color(79) bright white on blue
-
- delay(seconds)
- pauses for the specified number of 'seconds'
- returns a null string
- if 'seconds' is not specified, 1 is assumed
- Example: Result:
- RonSet X=delay(5) 5 second delay
-
- help(keyword)
- displays function-specific information from the documentation file
- Example: Result:
- RonSet X=help() gives a list of help topics
- RonSet X=help(char) gives help on the char() function
-
- RONSET.DOC must be available in the current directory or in one of
- the directories specified in the DPATH or APPEND path for this
- function to work properly.
-
-
- 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
- Example: Result:
- RonSet Z=zone(1:124/1113) Z=1
- RonSet Z=zone(2:760/5.15) Z=2
-
- net(address)
- returns the net portion of the specified address
- Example: Result:
- RonSet N=net(1:124/1113) N=124
- RonSet N=net(2:760/5.15) N=760
-
- node(address)
- returns the node portion of the specified address
- Example: Result:
- RonSet N=node(1:124/1113) N=1113
- RonSet N=node(2:760/5.15) N=5
-
- point(address)
- returns the point portion of the specified address
- Example: Result:
- RonSet P=point(1:124/1113) P= (not set)
- RonSet P=point(2:760/5.15) P=15
-
- 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
- Example: Result:
- RonSet N=lookup(Ron Bemis) P=124/1113
- RonSet N=lookup(Croc Dundee) P=3:777/123.5
-
-
- Date and time
- -------------
- The date() and time() functions work identically with one exception: if
- there are no parameters, the date() function uses a default parameter of
- "K, W d, Y", and the time() function uses a default parameter of "h:0m:0s".
- If parameters 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()
- parameters, 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 parameter causes a change in the way the hours are
- displayed. See the note above.
-
- "_" and "0" may be used only as prefixes on the parameters indicated above.
- If they are used elsewhere in the parameter string they are ignored. All
- other characters in the parameters are copied as-is into the output string.
-
- date(pattern)
- returns a string based on the current date and time
- Example: Result:
- RonSet D=date() D=Tuesday, February 6, 1990
- RonSet D=date(K, W d, Y) D=Tuesday, February 6, 1990
- RonSet D=date(w d) D=Feb 6
- RonSet S=date(0M/0d/y @ 0h:0m:0sa) S=02/06/90 @ 06:05:34pm
-
- time(pattern)
- returns a string based on the current date and time
- RonSet T=time() T=18:05:34
- RonSet T=time(h:0m:0s) T=18:05:34
- RonSet T=time(h:0m:0sa) T=6:05:34pm
-
-
- --- end of document ---
-
-