home *** CD-ROM | disk | FTP | other *** search
/ ProfitPress Mega CDROM2 …eeware (MSDOS)(1992)(Eng) / ProfitPress-MegaCDROM2.B6I / UTILITY / BATCH / RONSET25.ZIP / RONSET.DOC < prev    next >
Encoding:
Text File  |  1990-08-18  |  38.8 KB  |  993 lines

  1.  
  2.                             RONSET
  3.                             ------
  4.  
  5.                         Batch file enhancer
  6.                         Copyright (C) Ron Bemis 1990
  7.                         All rights reserved
  8.                         Version 2.3
  9.                           
  10.  
  11. I use DOS environment variables extensively, and I wanted a better way to
  12. set and use them.  I couldn't find it, so I wrote it myself.  Here it is -
  13. my idea of the ultimate batch file utility.  It lets you set environment
  14. variables to whatever you like... with brains.  It does what DOS should
  15. have done.  This program is the equivalent of the internal DOS SET command,
  16. but it's much more powerful.  You can use it just like you use SET.
  17.  
  18. I hope you'll enjoy this program, and I also hope that you'll consider
  19. sending in a registration if you like it.  Please let me know if you find
  20. something that doesn't work like you think it should.  Also, please let me
  21. know if you think of any enhancements for this program.
  22.  
  23.                  - Ron Bemis, FidoNet 124/1113, 214-231-3841
  24.  
  25. RONSET is shareware!  That means that if you use it on a regular basis, you
  26. must pay for it.  You are hereby granted a limited licence to use this
  27. program for a period of one month.  At the end of this month, you must
  28. either register this program or discontinue its use.  This program may NOT
  29. be used in a business, for-profit organization, or corporate environment
  30. without first being registered.  Registration price for this program is $20
  31. per machine.  Registrations should be mailed to:
  32.  
  33.                Ron Bemis
  34.                9601 Forest Ln #222
  35.                Dallas, TX  75243
  36.  
  37.  
  38. Happy batchin'!
  39.  
  40.  
  41. By the time you're done playing with this program, you should understand
  42. what the following line does and how it works:
  43.  
  44. RONSET fname=low(concat(hex(string(Net:,5)),hex(string(Node:,5))).REQ)
  45.  
  46. At least try each function by itself on the command line to see how they
  47. work.  Satisfy yourself that each function does work as you think it
  48. should.  I think there's about a zillion things you can do with this
  49. program if you cut loose with the creative juices.
  50.  
  51. The above illustrates how you can "nest" RONSET commands to execute a number
  52. of them at the same time and with respect to the same environment variable. 
  53. But we're gettin' ahead of ourselves, here. 
  54.  
  55.  
  56.         COMMAND SYNTAX:
  57.  
  58. RONSET variable_name=function(parameters)
  59.  
  60.         In which:
  61.  
  62. variable_name   is replaced by the name of the environment variable you
  63.                 want to create or replace;
  64.  
  65. function        is any one of the many functions listed in this
  66.                 documentation;
  67.  
  68. (parameters)    are additional commands you give to RONSET.  These commands
  69.                 are dependent upon the function you have asked for.
  70.  
  71. All function parameters MUST be enclosed entirely within parenthesis as
  72. shown above. In this documentaiton, the word "parameter" refers to whatever
  73. it is you're enclosing within the parenthesis.
  74.  
  75. Some other ways to use RONSET:
  76.  
  77. RONSET variable_name=               will clear the specified environment
  78.                                     variable (i.e. remove it from the
  79.                                     environment).
  80.  
  81. RONSET function(parameters)         will execute the function specified,
  82.                                     but not set an environment variable.
  83.  
  84.  
  85. Arithmetic functions
  86. --------------------
  87. All arithmetic is done with floating point numbers.
  88.  
  89. add(addend,addend)
  90.     returns the sum of the two values
  91.         Example:                            Result:
  92.         RonSet Sum=add(15,32)               SUM=47
  93.  
  94. sub(minuend,subtrahend)
  95.     returns the difference of the two values
  96.         Example:                            Result:
  97.         RonSet Diff=sub(19,25)              DIFF=-6
  98.  
  99. mult(multiplicand,multiplier)
  100.     returns the product of the two values
  101.         Example:                            Result:
  102.         RonSet Prod=mult(15,32)             PROD=480
  103.  
  104. div(dividend,divisor)
  105.     returns the quotient of the two values
  106.         Example:                            Result:
  107.         RonSet Quot=div(100,7)              QUOT=14.2857
  108.  
  109. eq(x,y)
  110.     returns 1 if x is equal to y, 0 otherwise
  111.         Example:                            Result:
  112.         RonSet X=eq(5,6)                    X=0
  113.         RonSet X=eq(5,5)                    X=1
  114.  
  115. ne(x,y)
  116.     returns 1 if x is not equal to y, 0 otherwise
  117.         Example:                            Result:
  118.         RonSet X=ne(5,6)                    X=1
  119.         RonSet X=ne(5,5)                    X=0
  120.  
  121. lt(x,y)
  122.     returns 1 if x is less than y, 0 otherwise
  123.         Example:                            Result:
  124.         RonSet X=lt(5,6)                    X=1
  125.         RonSet X=lt(5,5)                    X=0
  126.         RonSet X=lt(6,5)                    X=0
  127.  
  128. le(x,y)
  129.     returns 1 if x is less than or equal to y, 0 otherwise
  130.         Example:                            Result:
  131.         RonSet X=le(5,6)                    X=1
  132.         RonSet X=le(5,5)                    X=1
  133.         RonSet X=le(6,5)                    X=0
  134.  
  135. gt(x,y)
  136.     returns 1 if x is greater than y, 0 otherwise
  137.         Example:                            Result:
  138.         RonSet X=gt(5,6)                    X=0
  139.         RonSet X=gt(5,5)                    X=0
  140.         RonSet X=gt(6,5)                    X=1
  141.  
  142. ge(x,y)
  143.     returns 1 if x is greater than or equal to y, 0 otherwise
  144.         Example:                            Result:
  145.         RonSet X=ge(5,6)                    X=0
  146.         RonSet X=ge(5,5)                    X=1
  147.         RonSet X=ge(6,5)                    X=1
  148.  
  149. abs(x)
  150.     returns the absolute value of x
  151.         Example:                            Result:
  152.         RonSet X=abs(-5)                    X=5
  153.         RonSet X=abs(10)                    X=10
  154.         RonSet X=abs(-2.3)                  X=2.3
  155.  
  156. mod(x,y)
  157.     returns x modulo y
  158.         Example:                            Result:
  159.         RonSet Rmn=mod(15,4)                RMN=3
  160.         RonSet Rmn=mod(20,4)                RMN=0
  161.         RonSet Rmn=mod(17,13)               RMN=4
  162.  
  163. neg(x)
  164.     returns negative x
  165.         Example:                            Result:
  166.         RonSet Neg=neg(15)                  NEG=-15
  167.         RonSet Neg=neg(-7.3)                NEG=7.3
  168.  
  169. sqr(x)
  170.     returns x squared
  171.         Example:                            Result:
  172.         RonSet Big=sqr(83)                  BIG=6889
  173.         RonSet Big=sqr(-100)                BIG=10000
  174.         RonSet Big=sqr(23.5)                BIG=552.25
  175.  
  176. sqrt(x)
  177.     returns the square root of x
  178.         Example:                            Result:
  179.         RonSet Root=sqrt(9)                 ROOT=3
  180.         RonSet Root=sqrt(8.7)               ROOT=2.94958
  181.  
  182. pow(x,y)
  183.     returns x to the y power
  184.     this one is an exception to the rules about errorlevels
  185.     if invalid values are specified, a different type of error message (one
  186.     from the floating point run-time library) is displayed, and the program
  187.     may abort with an errorlevel other than 255.
  188.         Example:                            Result:
  189.         RonSet OneK=pow(2,10)               ONEK=1024
  190.         RonSet Big=pow(7,5)                 BIG=16807
  191.  
  192.  
  193. Binary functions
  194. ----------------
  195. All binary functions are done with 16-bit unsigned numbers.
  196.  
  197. and(x,y)
  198.     returns the bitwise AND of x and y
  199.         Example:                            Result:
  200.         RonSet X=and(14,7)                  X=6
  201.  
  202. or(x,y)
  203.     returns the bitwise OR of x and y
  204.         Example:                            Result:
  205.         RonSet X=or(14,7)                   X=15
  206.  
  207. xor(x,y)
  208.     returns the bitwise XOR of x and y
  209.         Example:                            Result:
  210.         RonSet X=xor(14,7)                  X=9
  211.  
  212. not(x)
  213.     returns the 1's complement of x
  214.         Example:                            Result:
  215.         RonSet X=not(14)                    X=65521
  216.  
  217. hex(x)
  218.     returns the 4-digit hexidecimal equivalent of x
  219.         Example:                            Result:
  220.         RonSet X=hex(124)                   X=007C
  221.         RonSet X=hex(1113)                  X=0459
  222.  
  223. oct(x)
  224.     returns the 6-digit octal equivalent of x
  225.         Example:                            Result:
  226.         RonSet O=oct(29127)                 O=070707
  227.         RonSet O=oct(4096)                  O=010000
  228.  
  229. bin(x)
  230.     returns the 16-digit binary equivalent of x
  231.         Example:                            Result:
  232.         RonSet B=oct(29127)                 B=0111000111000111
  233.         RonSet B=oct(4096)                  B=0001000000000000
  234.  
  235.  
  236. String functions
  237. ----------------
  238.  
  239. asc(string)
  240.     returns the decimal value of the first ASCII character of string
  241.         Example:                            Result:
  242.         RonSet A=asc(ABCDE)                 A=65
  243.         RonSet A=asc(XYZ)                   A=88
  244.         RonSet A=asc(z)                     A=122
  245.  
  246. chr(value)
  247.     returns an ASCII character specified by 'value'
  248.         Example:                            Result:
  249.         RonSet A=chr(65)                    A=A
  250.         RonSet A=chr(88)                    A=X
  251.         RonSet A=chr(122)                   A=z
  252.  
  253. concat(x,y,z...)
  254.     returns a string of concatinated strings
  255.         Example:                            Result:
  256.         RonSet X=concat(One, ,Two, ,Three)  X=One Two Three
  257.         RonSet X=concat(hex(124),hex(1113)) STR=007C0459
  258.  
  259.         This last example shows one of RONSET's most powerful functions -
  260.         embedded functions.  Functions can be embedded as deeply as you
  261.         want, you're limited only by DOS's command line length.
  262.  
  263.         To determine the order that RONSET will evaluate an expression,
  264.         start at the left side and look towards the right until you see a
  265.         right parenthesis ')'.  This is the closing parenthesis of the
  266.         first function that will be evaluated.  After the evaluation is
  267.         done, it gets put into the expression and the expression is
  268.         re-evaluated from the beginning.  This continues until all
  269.         functions have been evaluated.
  270.  
  271.         The last example above is evaluated in this order:
  272.  
  273.             concat(hex(124),hex(1113))
  274.                    -------^
  275.             concat(007C,hex(1113))
  276.                         --------^
  277.             concat(007C,0459)
  278.             ----------------^
  279.             007C0459
  280.  
  281.         It sometimes gets a little messy with all those parenthesis, but if
  282.         you miss one or get too many, the error message given by the
  283.         program should be quite helpful in finding the problem.  The
  284.         message displayed will show the part of the line that caused the
  285.         problem, with all earlier parts evaluated.
  286.  
  287.         In many cases, the concat() function is not needed.  The first
  288.         example above:
  289.  
  290.             RonSet X=concat(One, ,Two, ,Three)
  291.  
  292.         could just as easily have been written as:
  293.  
  294.             RonSet X=One Two Three
  295.  
  296.         But the second example:
  297.  
  298.             RonSet X=concat(hex(124),hex(1113))
  299.  
  300.         could not have been written without the concat() function because
  301.         of the order of evaluation.  If you do this:
  302.  
  303.             RonSet X=hex(124)hex(1113)
  304.  
  305.         RONSET will evaluate this expression to "007Chex(1113)" and will
  306.         give you an error message about an unknown function named
  307.         "007Chex".
  308.  
  309. len(string)
  310.     returns the length of 'string'
  311.         Example:                            Result:
  312.         RonSet L=len(Hi There!)             L=9
  313.  
  314. left(size,string)
  315.     returns the leftmost 'size' characters of 'string'
  316.         Example:                            Result:
  317.         RonSet L=left(4,Hi There!)          L=Hi T
  318.  
  319. mid(loc,size,string)
  320.     returns 'size' characters of 'string', starting at 'loc'.
  321.         Example:                            Result:
  322.         RonSet M=mid(4,3,Hi There!)         M=The
  323.  
  324. right(size,string)
  325.     returns the rightmost 'size' characters of 'string'
  326.         Example:                            Result:
  327.         RonSet R=right(4,Hi There!)         R=ere!
  328.  
  329. low(string)
  330.     returns 'string' in lowercase letters
  331.         Example:                            Result:
  332.         RonSet Small=low(Hi There!)         SMALL=hi there!
  333.  
  334. up(string)
  335.     returns 'string' in uppercase letters
  336.         Example:                            Result:
  337.         RonSet Big=up(Hi There!)            BIG=HI THERE!
  338.  
  339. pos(find,string)
  340.     returns the position of substring 'find' in 'string'
  341.     if 'find' is not found in 'string', 0 is returned
  342.     this search is case sensitive
  343.         Example:                            Result:
  344.         RonSet X=pos(The,Hi There!)         X=4
  345.         RonSet X=pos(Hi T,Hi There!)        X=1
  346.         RonSet X=pos(ere!,Hi There!)        X=6
  347.  
  348. replace(old,new,string)
  349.     returns 'string' with all occurances of 'old' changed to 'new'
  350.         Example:                            Result:
  351.         RonSet X=replace(123,xxx,212311233) X=2xxx1xxx3
  352.  
  353.  
  354. Comparing strings
  355. -----------------
  356.  
  357. eqs(x,y)
  358.     returns 1 if x is alphabetically equal to y, 0 otherwise
  359.         Example:                            Result:
  360.         RonSet X=eqs(A,B)                   X=0
  361.         RonSet X=eqs(A,A)                   X=1
  362.  
  363. nes(x,y)
  364.     returns 1 if x is alphabetically not equal to y, 0 otherwise
  365.         Example:                            Result:
  366.         RonSet X=nes(A,B)                   X=1
  367.         RonSet X=nes(A,A)                   X=0
  368.  
  369. lts(x,y)
  370.     returns 1 if x is alphabetically less than y, 0 otherwise
  371.         Example:                            Result:
  372.         RonSet X=lts(A,B)                   X=1
  373.         RonSet X=lts(A,A)                   X=0
  374.         RonSet X=lts(B,A)                   X=0
  375.  
  376. les(x,y)
  377.     returns 1 if x is alphabetically less than or equal to y, 0 otherwise
  378.         Example:                            Result:
  379.         RonSet X=les(A,B)                   X=1
  380.         RonSet X=les(A,A)                   X=1
  381.         RonSet X=les(B,A)                   X=0
  382.  
  383. gts(x,y)
  384.     returns 1 if x is alphabetically greater than y, 0 otherwise
  385.         Example:                            Result:
  386.         RonSet X=gts(A,B)                   X=0
  387.         RonSet X=gts(A,A)                   X=0
  388.         RonSet X=gts(B,A)                   X=1
  389.  
  390. ges(x,y)
  391.     returns 1 if x is alphabetically greater than or equal to y, 0 otherwise
  392.         Example:                            Result:
  393.         RonSet X=ges(A,B)                   X=0
  394.         RonSet X=ges(A,A)                   X=1
  395.         RonSet X=ges(B,A)                   X=1
  396.  
  397. alpha(string)
  398.     returns 1 if 'string' is entirely alphabetic characters, 0 otherwise
  399.         Example:                            Result:
  400.         RonSet X=alpha(abc123xyz)           X=0
  401.         RonSet X=alpha(abcXYZABC)           X=1
  402.  
  403. num(string)
  404.     returns 1 if 'string' is entirely numeric characters, 0 otherwise
  405.         Example:                            Result:
  406.         RonSet X=num(abc123xyz)             X=0
  407.         RonSet X=num(123987)                X=1
  408.  
  409. number(string)
  410.     returns 1 if 'string' is a number, 0 otherwise
  411.     just like num(), except this one allows '-', '+', and '.'
  412.         Example:                            Result:
  413.         RonSet X=number(abc123xyz)          X=0
  414.         RonSet X=number(123987)             X=1
  415.         RonSet X=number(-123.987)           X=1
  416.  
  417.  
  418. Getting input
  419. -------------
  420.  
  421. char(prompt,allowed,seconds)
  422.     returns a single character entered from the keyboard
  423.     optional 'prompt' will be displayed to the screen
  424.     optional 'allowed' restricts input to specified characters
  425.     optional 'seconds' sets a timeout for entering a key
  426.     if 'seconds' is used, a timer displays on-screen during last 10 seconds
  427.     if timeout or user presses enter, esc, or ctrl-C, this returns nothing
  428.         Example:                            Result:
  429.         RonSet X=char()                     X=char pressed
  430.         RonSet X=char(What?)                X=char pressed, with prompt
  431.         RonSet X=char(,XYZ)                 X=char pressed, XYZ only allowed
  432.         RonSet X=char(,,5)                  X=char pressed
  433.                                             X=nothing if timer expires
  434.         RonSet X=char(Really?,YyNn,5)       X=char pressed, YyNn only allowed
  435.                                             X=nothing if timer expires
  436.  
  437. string(prompt,maxlength)
  438.     returns a string as entered from the keyboard
  439.     optional 'prompt' will be displayed to the screen
  440.     optional 'maxlength' restricts input to 'maxlength' characters
  441.     default 'maxlength' if not specified is 80
  442.         Example:                            Result:
  443.         RonSet X=string()                   X=user's input, up to 80 chars
  444.         RonSet X=string(Your name:)         X=user's input, with prompt
  445.         RonSet X=string(Really?,1)          X=user's input, up to 1 char
  446.  
  447.  
  448. Exit errorlevel
  449. ---------------
  450. Normally RONSET exits with errorlevel 0.  In the event of an error, it will
  451. exit with errorlevel 255 after displaying an error message.
  452.  
  453. level(value)
  454.     exit with errorlevel 'value' immediately
  455.     this does an immediate exit and doesn't set any environment variables
  456.         Example:                            Result:
  457.         RonSet X=string(Your name:)         X=Ron Bemis
  458.         RonSet X=level(len(%X%))            errorlevel 9 (X unchanged)
  459.         If Not Errorlevel 1 Goto NoName
  460.  
  461.         This example is meant to be taken as a batch file fragment rather
  462.         than as separate examples.  It illustrates the fact that if you use
  463.         the level() function, the variable specified to the left of the
  464.         equal sign is not effected.  Note that the %X% notation only works
  465.         in batch files, not from the command line.
  466.  
  467.  
  468. Filenames
  469. ---------
  470.  
  471. file(fspec)
  472.     returns the base filename and extension of 'fspec'
  473.     wildcards are not expanded
  474.     no check is made for the file's existance
  475.         Example:                            Result:
  476.         RonSet F=file(c:\dos\command.com)   F=command.com
  477.         RonSet F=file(E:\UTIL\*.BAT)        F=*.BAT
  478.  
  479. name(fspec)
  480.     returns only the base filename of 'fspec'
  481.     wildcards are not expanded
  482.     no check is made for the file's existance
  483.         Example:                            Result:
  484.         RonSet F=name(c:\dos\command.com)   F=command
  485.         RonSet F=name(E:\UTIL\*.BAT)        F=*
  486.  
  487. ext(fspec)
  488.     returns only the extension of 'fspec'
  489.     wildcards are not expanded
  490.     no check is made for the file's existance
  491.         Example:                            Result:
  492.         RonSet F=ext(c:\dos\command.com)    F=.com
  493.         RonSet F=ext(E:\UTIL\*.BAT)         F=.BAT
  494.         RonSet F=ext(c:\test)               F=      (not set)
  495.  
  496. drive(fspec)
  497.     returns only the drive letter and ":" of 'fspec'
  498.     no check is made for the file's existance
  499.     no check is made to see if the drive is valid
  500.         Example:                            Result:
  501.         RonSet F=drive(c:\dos\command.com)  F=c:
  502.         RonSet F=drive(E:\UTIL\*.BAT)       F=E:
  503.  
  504. path(fspec)
  505.     returns only the directory path of 'fspec'
  506.     no check is made for the file's existance
  507.     no check is made to see if the directory path is valid
  508.         Example:                            Result:
  509.         RonSet F=path(c:\dos\command.com)   F=\dos\
  510.         RonSet F=path(E:\UTIL\*.BAT)        F=\UTIL\
  511.  
  512. full(fspec)
  513.     returns the fully-qualified filespec of 'fspec'
  514.     wildcards are not expanded
  515.     current drive and path are used if 'fspec' does not contain them
  516.     if 'fspec' is not specified, current drive and path are returned
  517.         Example:                            Result:
  518.         RonSet F=full(command.com)          F=D:\MY\CURDIR\COMMAND.COM
  519.         RonSet F=full(E:*.BAT)              F=E:\CURDIR\ON_DR_E\*.BAT
  520.         RonSet F=full()                     F=D:\MY\CURDIR\
  521.  
  522. dir(drive)
  523.     returns the drive letter, ":" and current directory path of 'drive'
  524.     if 'drive' is not specified, current drive is used
  525.         Example:                            Result:
  526.         RonSet F=dir()                      F=D:\MY\CURDIR\
  527.         RonSet F=dir(D)                     F=D:\MY\CURDIR\
  528.         RonSet F=dir(E)                     F=E:\CURDIR\ON_DR_E\
  529.  
  530. exist(fspec)
  531.     returns 1 if 'fpsec' exists, 0 otherwise
  532.     wildcards are allowed
  533.         Example:                            Result:
  534.         RonSet X=exist(C:\AUTOEXEC.BAT)     X=1
  535.         RonSet X=exist(C:\GONE\MISSING.*)   X=0
  536.  
  537. matches(fspec)
  538.     returns the number of files that match 'fspec'
  539.     wildcards are (obviously) allowed
  540.         Example:                            Result:
  541.         RonSet X=matches(*.EXE)             X=5
  542.         RonSet X=matches(C:\DOS\*.*)        X=48
  543.  
  544. expand(fspec,number)
  545.     returns the 'number'th fully-qualified filespec matching 'fspec'
  546.     wildcards are (obviously) allowed
  547.     if 'number' is not specified the first match is returned
  548.     if no parameters are specified, the current drive and path are returned
  549.         Example:                            Result:
  550.         Ronset X=expand()                   X=D:\BINKLEY\
  551.         RonSet X=expand(command.com)        X=C:\DOS\COMMAND.COM
  552.         RonSet X=expand(C:\*.BAT)           X=C:\AUTOEXEC.BAT
  553.         RonSet X=expand(C:\WORK\*.OBJ)      X=C:\WORK\MYPROG.OBJ
  554.         RonSet X=expand(C:\WORK\*.OBJ,2)    X=C:\WORK\MYPROG2.OBJ
  555.  
  556. size(fpsec)
  557.     returns the size of 'fspec'
  558.     wildcards are not allowed
  559.         Example:                            Result:
  560.         RonSet S=size(C:\AUTOEXEC.BAT)      S=3289
  561.  
  562. fdate(fpsec)
  563.     returns the date of 'fspec'
  564.     if wildcards exist, the date of the first match is returned
  565.     the format is suitable for string comparisons against other file dates
  566.         Example:                            Result:
  567.         RonSet S=fdate(C:\AUTOEXEC.BAT)     S=1990-02-06 14:56:26
  568.  
  569. wild(fspec)
  570.     returns 1 if 'fspec' contains wildcards, 0 otherwise
  571.         Example:                            Result:
  572.         RonSet W=wild(C:*.c)                W=1
  573.         RonSet W=wild(D:\utils\myprog.c)    W=0
  574.  
  575. diff(fspec1,fspec2)
  576.     returns 0 if files are identical
  577.     returns 1 if 'fspec1' is missing
  578.     returns 2 if 'fspec2' is missing
  579.     returns 3 if files are different
  580.         Example:
  581.         RonSet D=diff(test.old,test.new)
  582.  
  583. lines(fspec)
  584.     returns the number of lines in 'fspec'
  585.     wildcards are not allowed
  586.     'fspec' should be a text file
  587.         Example:                            Result:
  588.         RonSet S=lines(C:\CONFIG.SYS)       S=12
  589.  
  590. read(fspec,number)
  591.     returns the 'number'th line in 'fspec'
  592.     if 'number' is not specified the first line is returned
  593.     wildcards are not allowed
  594.     'fspec' should be a text file
  595.         Example:                            Result:
  596.         RonSet L=read(C:\CONFIG.SYS)        L=BREAK=ON
  597.         RonSet L=read(C:\AUTOEXEC.BAT,84)   L=Set BBS=D:\BINK
  598.  
  599. write(fspec,line)
  600.     writes 'line' at the end of 'fspec'
  601.     if 'fspec' does not exist, it is created
  602.     wildcards are not allowed
  603.     returns 'line'
  604.     'fspec' should be a text file
  605.         Example:
  606.         RonSet L=write(TEST.BAT,@ECHO OFF)
  607.         RonSet L=write(TEST.BAT,DATE date(M/d/y))
  608.  
  609. attr(fspec)
  610.     returns the attributes of 'fspec'
  611.     return value is created by ORing these bit values together:
  612.     bit 0   0x01    Read-only
  613.     bit 1   0x02    Hidden
  614.     bit 2   0x04    System
  615.     bit 4   0x10    Directory
  616.     bit 5   0x20    Archive
  617.         Example:                            Result:
  618.         RonSet A=attr(C:\AUTOEXEC.BAT)      A=32    (archive)
  619.         RonSet A=attr(C:\OS2KRNL)           A=7     (system,hidden,read-only)
  620.         RonSet A=attr(C:\DOS)               A=16    (directory)
  621.  
  622. label(drive)
  623.     returns the volume label of 'drive'
  624.     if 'drive' is not specified, current drive is used
  625.         Example:                            Result:
  626.         RonSet L=label()                    L=MYDISK#1.
  627.  
  628. batch(fspec)
  629.     executes the contents of 'fspec' as individual RONSET commands
  630.     returns nothing
  631.     wildcards are not allowed
  632.     nesting is not allowed
  633.         Example:
  634.         RonSet batch(MARY.RON)
  635.  
  636.         This command functions a little like the level() command.  After
  637.         the batch file has been executed, RONSET will exit, and other
  638.         parameters are ignored.  For example, the following two commands
  639.         function identically:
  640.             RonSet batch(concat(MARY,.,RON))
  641.             RonSet X=left batch(MARY.RON) right
  642.         In the second command, "left" and "right" are ignored, and X will
  643.         not be changed.
  644.  
  645.  
  646. Peeking into files
  647. ------------------
  648. The byte(), word(), and long() functions all return unsigned numbers.
  649.  
  650. byte(location,filespec)
  651.     returns a byte (8 bits) at 'location' in 'filespec'
  652.     'location' is relative to zero (i.e. the first byte is at location 0)
  653.         Example:                            Result:
  654.         RonSet B=byte(2,C:\autoexec.bat)    B=99   'c' of @Echo Off
  655.  
  656. word(location,filespec)
  657.     returns a word (16 bits) at 'location' in 'filespec'
  658.     'location' is relative to zero (i.e. the first word is at location 0)
  659.         Example:                            Result:
  660.         RonSet W=word(0,C:\UTIL\RONSET.EXE) W=23117   'MZ' on every .EXE
  661.  
  662. long(location,filespec)
  663.     returns a longword (32 bits) at 'location' in 'filespec'
  664.     'location' is relative to zero (i.e. the first longword is at location 0)
  665.         Example:
  666.         RonSet L=long(8192,NODELIST.IDX)
  667.  
  668. line(location,filespec)
  669.     returns a string from 'location' in 'filespec'
  670.     'location' is relative to zero (i.e. the first longword is at location 0)
  671.         Example:                            Result:
  672.         RonSet Z=asciiz(6,C:\autoexec.bat)  Z=Off   of @Echo Off
  673.  
  674.  
  675. Sound
  676. -----
  677.  
  678. sound(len,tone...)
  679.     'len' specifies the length in milliseconds for each tone to play
  680.     'tone' is the frequency of the tone to play
  681.     returns a null string
  682.     missing tones are "held" tones (i.e. two commas together)
  683.     a 'tone' of 0 is silence
  684.         Example:                            Result:
  685.         RonSet X=Sound(500,440,,880)        Plays middle C for 1 second
  686.                                             and high C for 1/2 second
  687.         RonSet X=Sound(200,440,440,440)     Plays middle C 3 times
  688.         RonSet X=Sound(1000)                Delay for 1 second
  689.  
  690.  
  691. Miscellaneous
  692. -------------
  693.  
  694. echo(string)
  695.     displays 'string' to the standard output
  696.     returns 'string'
  697.         Example:                            Result:
  698.         RonSet JBrown=echo(I feel good!)    JBROWN=I feel good!  (with output)
  699.  
  700. exec(doscommand)
  701.     executes 'doscommand' and returns the errorlevel
  702.         Example:                            Result:
  703.         RonSet X=exec(PkUnZip)              X=10    (no parameters)
  704.         RonSet X=exec(command /c dir)       X=0
  705.  
  706. trans(variable)
  707.     returns the contents of the environment 'variable'
  708.     mainly for use in RONSET batch() input files
  709.     this function works much like DOS's %variable% notation
  710.         Example:                            Result:
  711.         RonSet C=trans(COMSPEC)             C=I:\COMMAND.COM
  712.         RonSet B=trans(bbs)                 B=D:\BINK
  713.  
  714. free(drive)
  715.     returns amount of free space on 'drive'
  716.     if 'drive' is not specified, current drive is assumed
  717.         Example:                            Result:
  718.         RonSet F=free()                     F=12959744
  719.         RonSet F=free(c)                    F=12969744
  720.         RonSet F=free(d)                    F=23943168
  721.  
  722. used(drive)
  723.     returns amount of used space on 'drive'
  724.     if 'drive' is not specified, current drive is assumed
  725.         Example:                            Result:
  726.         RonSet U=used()                     F=20494336
  727.         RonSet U=used(d)                    F=9510912
  728.  
  729. total(drive)
  730.     returns total amount of space on 'drive'
  731.     if 'drive' is not specified, current drive is assumed
  732.         Example:                            Result:
  733.         RonSet S=total()                    F=33454080
  734.         RonSet S=total(d)                   F=33454080
  735.  
  736. tenv()
  737.     returns total environment space
  738.     any parameters are ignored
  739.         Example:                            Result:
  740.         RonSet T=tenv()                     T=1024
  741.  
  742. env()
  743.     returns amount of free environment space
  744.     any parameters are ignored
  745.     this value is calculated before RONSET sets its variable
  746.         Example:                            Result:
  747.         RonSet T=env()                      T=263
  748.  
  749. ver(type)
  750.     returns the DOS version number
  751.     if 'type' is "major", the major number is returned (3)
  752.     if 'type' is "minor", the minor number is returned (30)
  753.     if 'type' is "both", both are returned (3.30)
  754.     if 'type' is not specified, "both" is assumed
  755.         Example:                            Result:
  756.         RonSet V=ver()                      V=3.30      (DOS 3.3)
  757.         RonSet V=ver()                      V=10.10     (OS/2 V1.1)
  758.         RonSet V=ver(major)                 V=3         (DOS 3.X)
  759.         RonSet V=ver(minor)                 V=10        (DOS X.1)
  760.         RonSet V=ver(both)                  V=2.11      (DOS 2.11)
  761.  
  762. if(test,true,false)
  763.     returns 'false' if the value of 'test' is 0, returns 'true' otherwise
  764.     if 'true' is not specified, nothing is returned when 'test' is non-zero
  765.     if 'false' is not specified, nothing is returned when 'test' is zero
  766.         Example:                            Result:
  767.         RonSet M=if(lt(ver(major),9),D,R)   M=D  (DOS version < 9.0)
  768.                                             M=R  (OS/2 real mode)
  769.         RonSet Prompt=concat($P,if(lt(ver(major),9),*$G,$G))
  770.                                             PROMPT=$P*$G (DOS version < 9.0)
  771.                                             PROMPT=$P$G  (OS/2 real mode)
  772.  
  773.         It's important to remember the order that expressions are evaluated
  774.         when using this function.  Both 'true' and 'false' are evaluated
  775.         before the 'if' function is evaluated.  This function is useful for
  776.         returning a value based on a test, not for conditional execution.
  777.         For example, this won't work:
  778.  
  779.             if(0,exec(command /c delete *.bat),echo(No!))
  780.  
  781.         because both the exec() and the echo() functions will be executed
  782.         before the if() function is.
  783.  
  784. prn(lpt)
  785.     returns printer status - created by ORing these bit values together:
  786.     bit 0   0x01    Timed out
  787.     bit 3   0x08    I/O error
  788.     bit 4   0x10    Selected
  789.     bit 5   0x20    Out of paper
  790.     bit 6   0x40    Acknowledge
  791.     bit 7   0x80    Not busy
  792.     if 'lpt' is not specified, 1 is assumed (LPT1)
  793.         Example:                            Result:
  794.         RonSet P=prn(1)                     P=144  (0x90 - online)
  795.                                             P=8    (0x08 - offline)
  796.                                             P=200  (0xC8 - printer off)
  797.  
  798. rand(max)
  799.     returns a random number in the range 0 to 'max'-1
  800.         Example:
  801.         RonSet X=rand(5)                    X=0,1,2,3 or 4
  802.  
  803. info()
  804.     displays information about this version of RONSET
  805.     returns the RONSET version number string
  806.         Example:                            Result:
  807.         RonSet X=info()                     X=V2.3
  808.  
  809. comm(port)
  810.     returns comm port status - created by ORing these bit values together:
  811.     bit 0   0x0001  Change in clear to send (CTS)
  812.     bit 1   0x0002  Change in data set read (DSR)
  813.     bit 2   0x0004  Trailing edge ring detector
  814.     bit 3   0x0008  Change in receive line signal detector (DCD)
  815.     bit 4   0x0010  Clear to send (CTS)
  816.     bit 5   0x0020  Data set ready (DSR)
  817.     bit 6   0x0040  Ring indicator
  818.     bit 7   0x0080  Received line signal detect (DCD)
  819.     bit 8   0x0100  Data ready
  820.     bit 9   0x0200  Overrun error
  821.     bit 10  0x0400  Parity error
  822.     bit 11  0x0800  Framing error
  823.     bit 12  0x1000  Break detect
  824.     bit 13  0x2000  Transmit holding register empty
  825.     bit 14  0x4000  Transmit shift register empty
  826.     bit 15  0x8000  Time out
  827.     if 'port' is not specified, 1 is assumed (COM1)
  828.         Example:                            Result:
  829.         RonSet P=comm(1)                    P=24880 (0x6130)
  830.                                                 tx shift/holding empty
  831.                                                 data ready
  832.                                                 DSR/CTS on
  833.  
  834. color(value)
  835.     sets the monitor display colors
  836.     returns nothing
  837.     if 'value' is not specified, 7 is assumed (gray on black)
  838.     type the sample COLOR.LST for values
  839.     hint: after setting a color, use the DOS CLS command to fill screen
  840.         Example:                            Result:
  841.         RonSet X=color(79)                  bright white on blue
  842.  
  843. delay(seconds)
  844.     pauses for the specified number of 'seconds'
  845.     returns a null string
  846.     if 'seconds' is not specified, 1 is assumed
  847.         Example:                            Result:
  848.         RonSet X=delay(5)                   5 second delay
  849.  
  850. help(keyword)
  851.     displays function-specific information from the documentation file
  852.         Example:                            Result:
  853.         RonSet X=help()                     gives a list of help topics
  854.         RonSet X=help(char)                 gives help on the char() function
  855.  
  856.         RONSET.DOC must be available in the current directory or in one of
  857.         the directories specified in the DPATH or APPEND path for this
  858.         function to work properly.
  859.  
  860.  
  861. FidoNet
  862. -------
  863. These functions will probably be worthless to you unless you operate a node
  864. in the FidoNet nodelist.  An 'address' may have any of the following forms:
  865.     zone:net/node.point     (full address)
  866.     zone:net/node           (point 0 assumed)
  867.     net/node.point          (same zone assumed)
  868.     net/node                (same zone, point 0 assumed)
  869.     node.point              (same zone and net assumed)
  870.     node                    (same zone and net, point 0 assumed)
  871.     .point                  (same zone, net and node assumed)
  872.  
  873. zone(address)
  874.     returns the zone portion of the specified address
  875.         Example:                            Result:
  876.         RonSet Z=zone(1:124/1113)           Z=1
  877.         RonSet Z=zone(2:760/5.15)           Z=2
  878.  
  879. net(address)
  880.     returns the net portion of the specified address
  881.         Example:                            Result:
  882.         RonSet N=net(1:124/1113)            N=124
  883.         RonSet N=net(2:760/5.15)            N=760
  884.  
  885. node(address)
  886.     returns the node portion of the specified address
  887.         Example:                            Result:
  888.         RonSet N=node(1:124/1113)           N=1113
  889.         RonSet N=node(2:760/5.15)           N=5
  890.  
  891. point(address)
  892.     returns the point portion of the specified address
  893.         Example:                            Result:
  894.         RonSet P=point(1:124/1113)          P=      (not set)
  895.         RonSet P=point(2:760/5.15)          P=15
  896.  
  897. lookup(name)
  898.     returns the address of the specified name
  899.     'name' should be in the format "First Last" (without the quotes)
  900.     last name is optional
  901.     USERLIST.DOG is searched first if it exists, then FIDOUSER.LST
  902.     if BBS is defined, these files must be located there (SET BBS=C:\OPUS)
  903.     if BBS is undefined, these files must be in the current directory
  904.     most nodelist compilers can generate FIDOUSER.LST for you
  905.     each line in the file must be exactly the same length
  906.     both files must be sorted alphabetically
  907.         Example:                            Result:
  908.         RonSet N=lookup(Ron Bemis)          P=124/1113
  909.         RonSet N=lookup(Croc Dundee)        P=3:777/123.5
  910.  
  911.  
  912. Date and time
  913. -------------
  914. The date() and time() functions work identically with one exception:  if
  915. there are no parameters, the date() function uses a default parameter of
  916. "K, W d, Y", and the time() function uses a default parameter of "h:0m:0s".
  917. If parameters are included, they are interpretted as follows:
  918.  
  919. j   the julian (actually gregorian) date (1-366)
  920. _j  same as above, but space-padded on the left to three characters
  921. 0j  same as above, but 0-padded on the left to three digits
  922.     the capital letter "J" may also be used instead of "j"
  923.  
  924. K   the day of the week, spelled out (Sunday-Saturday)
  925. k   the first three letters of the day of the week (Sun-Sat)
  926.  
  927. x   the day of the week, as a number (0-6)
  928.     the capital letter "X" may also be used instead of "x"
  929.  
  930. Y   the full 4-digit year
  931. y   the last two digits of the year
  932.  
  933. M   the month of the year, as a number (1-12)
  934. _M  same as above, but space-padded on the left to two characters
  935. 0M  same as above, but 0-padded on the left to two digits
  936.  
  937. W   the month of the year, spelled out (January-December)
  938. w   the first three letters of the month of the year (Jan-Dec)
  939.  
  940. d   the date of the month (1-31)
  941. _d  same as above, but space-padded on the left to two characters
  942. 0d  same as above, but 0-padded on the left to two digits
  943.     the capital letter "D" may also be used instead of "d"
  944.  
  945. h   the hour (0-23 or 1-12) see note below
  946. _h  same as above, but space-padded on the left to two characters
  947. 0h  same as above, but 0-padded on the left to two digits
  948.     the capital letter "H" may also be used instead of "h"
  949.  
  950.     Note:
  951.         If the am/pm notation is used, the hour will be returned as a
  952.         number between 1 and 12.  Otherwise, it will be returned as a
  953.         number between 0 and 23 (military time).  In other words, if you
  954.         include an "a", "A", "p", or "P" anywhere in the date() or time()
  955.         parameters, you'll get something between 1 and 12.  If you don't use
  956.         one of these, you'll get something between 0 and 23.
  957.  
  958. m   the minute (0-59)
  959. _m  same as above, but space-padded on the left to two characters
  960. 0m  same as above, but 0-padded on the left to two digits
  961.  
  962. s   seconds (0-59)
  963. _s  same as above, but space-padded on the left to two characters
  964. 0s  same as above, but 0-padded on the left to two digits
  965.     the capital letter "S" may also be used instead of "s"
  966.  
  967. a   am/pm notation (am-pm)
  968.     any of the letters "A", "p", or "P" may also be used instead of "a"
  969.     The use of this parameter causes a change in the way the hours are
  970.     displayed. See the note above.
  971.  
  972. "_" and "0" may be used only as prefixes on the parameters indicated above.
  973. If they are used elsewhere in the parameter string they are ignored.  All
  974. other characters in the parameters are copied as-is into the output string.
  975.  
  976. date(pattern)
  977.     returns a string based on the current date and time
  978.         Example:                            Result:
  979.         RonSet D=date()                     D=Tuesday, February 6, 1990
  980.         RonSet D=date(K, W d, Y)            D=Tuesday, February 6, 1990
  981.         RonSet D=date(w d)                  D=Feb 6
  982.         RonSet S=date(0M/0d/y @ 0h:0m:0sa)  S=02/06/90 @ 06:05:34pm
  983.  
  984. time(pattern)
  985.     returns a string based on the current date and time
  986.         RonSet T=time()                     T=18:05:34
  987.         RonSet T=time(h:0m:0s)              T=18:05:34
  988.         RonSet T=time(h:0m:0sa)             T=6:05:34pm
  989.  
  990.  
  991.                          --- end of document ---
  992.  
  993.