home *** CD-ROM | disk | FTP | other *** search
/ High Voltage Shareware / high1.zip / high1 / DIR2 / ASET10.ZIP / ASET.DOC next >
Text File  |  1993-05-06  |  84KB  |  2,356 lines

  1.  
  2.  
  3.                            #     #####                 
  4.                           # #   #     #  ######   #####
  5.                          #   #  #        #          #  
  6.                         #     #  #####   #####      #  
  7.                         #######       #  #          #  
  8.                         #     # #     #  #          #  
  9.                         #     #  #####   ######     #  
  10.  
  11.  
  12.  
  13.  
  14. You can get part of the following documentation by invoking the program with
  15. the switches -v, -h, or -H . See README.TXT for more information.
  16.  
  17. -----------------------------------   -v   ------------------------------------
  18. ASET v1.0 -- Advanced SET command
  19. Copr (c) 1992,1993 Richard Breuer. ASET is freeware. No warranties.
  20.  
  21. This is ASET/2 v1.0 - renamed to ASET (from RUTILS 4).
  22.  
  23. Author: Richard Breuer
  24.         Brunssumstrasse 6
  25.         5100 Aachen
  26.         (after Jul 1, 1993: 52074 Aachen)
  27.         Germany
  28.         Europe
  29.  
  30. Phone:  +49/241/85605
  31. Fax:    +49/241/8021329
  32.  
  33. Email:  ricki@pool.informatik.rwth-aachen.de (Preferred!)
  34.  
  35. -----------------------------------   -h   ------------------------------------
  36. ASET v1.0 -- Advanced SET command
  37. Copr (c) 1992,1993 Richard Breuer. ASET is freeware. No warranties.
  38.  
  39. Usage:
  40.    ASET [-ef:hHnprv*] [target {=|:=} expression]
  41.  
  42. Options (Combined options are not allowed; -e and -f are mutually exclusive):
  43.    -e       Set the ERRORLEVEL according to the result
  44.    -f[file] Read a list of statements from file rather than the command line;
  45.             if file is omitted, standard input is read
  46.    -h       Display this help screen
  47.    -H       Display another help screen with notes and examples
  48.    -n       Do not SET anything (if not -e, -n implies -p)
  49.    -p       Print the result on stdout (default is quiet operation)
  50.    -r       Repeat the assignment on stdout (default is quiet operation)
  51.    -v       Display version info and information about the author
  52.    -*       Display internal information (for debugging purposes)
  53.  
  54. -----------------------------------   -H   ------------------------------------
  55. ASET v1.0 -- Advanced SET command
  56. Copr (c) 1992,1993 Richard Breuer. ASET is freeware. No warranties.
  57.  
  58. Notes:
  59.    ASET is a powerful tool for batch files. Refer to the manual or the
  60.    quick reference for details about each function. Please note that ASET,
  61.    unlike the other RUTILS programs, does not accept combined options, ie.
  62.    -en is not allowed. You must use -e -n instead.
  63.  
  64. Examples:
  65.    ASET BUF = BUFFERS
  66.       Assigns the value of the BUFFERS directive in CONFIG.SYS to the shell
  67.       variable BUF. Use %BUF% to access the value in your batch file.
  68.    ASET /fDEFAULT.SET
  69.       Reads DEFAULT.SET and sets the environment variables appropriately. The
  70.       file is expected to contain lines like "A := SIN(3*4-11)+COS(SIN(1))"
  71.       or "B = FEXPAND('.')".
  72.    ASET X:=SIN(%Y%)+%Z%*COS(%Y%)    /* assign X the result of a formula */
  73.    ASET -n -f                       /* read assignments from stdin */
  74.    ASET -e -n X:=BUFFERS gt 20      /* ERRORLEVEL 1, if condition holds */
  75.    ASET -p PWD=DIR                  /* assign PWD the current directory */
  76.    CMDGEN | ASET -f                 /* process CMDGEN's output */
  77.  
  78. -------------------------------------------------------------------------------
  79.  
  80. 0   Introduction
  81. ----------------
  82.   ASET/2 is an improved version of RUTILS 3.0's ASET command. I added an
  83.   expression parser which allows the construction of infix expressions as
  84.   in normal arithmetic expressions, like 1+2*3. It follows the standard
  85.   operator precedences.
  86.  
  87.   The following documentation covers the following topics:
  88.  
  89.         0   Introduction
  90.         1   Using ASET
  91.         2   Caveats and workarounds
  92.         3   The parser
  93.         4   The type concept in ASET
  94.         5   Intrinsic operators
  95.         6   Functions
  96.         7   Overview over ASETs functions
  97.         7.1   Alphabetic list of ASETs functions
  98.         7.2   List of ASETs functions, sorted by categories
  99.         8   Documentation of ASETs functions
  100.         9   Details
  101.         9.1   Evaluation Errors
  102.         9.2   Internal data representation
  103.         9.3   Further notes
  104.  
  105.  
  106. 1   Using ASET
  107. --------------
  108.   ASET is designed as a utility to enhance DOS batch files, as well as kind
  109.   of a desktop calculator. Besides, it can help to install and configure your
  110.   software.
  111.  
  112.   There are two modes of operation:
  113.  
  114.   Command line operation:
  115.         This is the default mode, which is used whenever ASET is started
  116.         without the /f switch. Some examples for command line mode are
  117.  
  118.                 ASET LIB='C:\LIB'
  119.                 ASET SORT=DOSPATH('SORT.EXE')
  120.                 ASET RESULT=sin(%PHI%)+%X%*COS(%PHI%)
  121.  
  122.         One disadvantage of this mode is that DOS must load ASET into memory
  123.         whenever it is invoked. This may become slow because of its size.
  124.         One way to avoid this, is the file operation mode (ASET will have to
  125.     be loaded only once for an arbitrary number of assignment operations).
  126.         Look below for the useful -r option.
  127.  
  128.   File operation:
  129.         This mode is used if ASET is invoked with the /f switch. It then
  130.         reads its input from a file, not from the command line. This file
  131.         is expected to contains lines like the above. There can be an
  132.         arbitrary number of these lines. Empty lines or lines starting with
  133.         '#' are treated as comment lines, and ignored. Lines longer than
  134.         255 characters are truncated.
  135.  
  136.         If you use /f without an argument, ASET reads commands from the
  137.         standard input. Examples:
  138.  
  139.                 ASET /fMYINST.CMD
  140.                 CMDGEN | ASET /f /n
  141.                 ASET /n /f
  142.  
  143.         In the first example, ASET will read its commands from MYINST.CMD. This
  144.     gives you a nice possibilty to store several configuration settings in
  145.     different files, and let ASET execute one of them according to your
  146.     installment needs.
  147.  
  148.         In the second example, CMDGEN is expected to write ASET commands on
  149.         standard output. ASET will then read these commands and execute them.
  150.  
  151.         The third example shows how ASET can be used as a calculator. It reads
  152.         commands from the keyboard until you input Ctrl/Z. This behaviour is
  153.         due to the empty filename parameter of the /f switch. See below for
  154.         the /n switch.
  155.  
  156.   Besides the /f option which switches between command line and file mode,
  157.   there are some other options:
  158.  
  159.   -e    Normally, ASET sets a shell variable to a value which is calculated
  160.         in a certain formula. It then finishes operation. -e lets ASET set
  161.         the ERRORLEVEL in addition to the shell variable. The ERRORLEVEL can
  162.         only be set to values 0..255. This makes it necessary to make some
  163.         assumptions:
  164.           - if the result is not a number, the ERRORLEVEL is set to
  165.             the ASCII code of the first character. Consider a result
  166.             'Auto'. ERRORLEVEL would be set to 65 in this case.
  167.           - if the result is empty, ERRORLEVEL is set to 0.
  168.           - if the result is a negative number, 'abs' is applied to
  169.             the number and...
  170.           - if the number is greater than 255, number is set to 255 and...
  171.           - ERRORLEVEL is set to the number.
  172.  
  173.         Note that -e makes it impossible to determine whether ASET has been
  174.         invoked with -h, -H, or -v (in these cases the ERRORLEVEL is set to 1)
  175.         or if a runtime error occurred (in which case it is set to 255).
  176.  
  177.         The -e switch can be a powerful enhancement to your batch files.
  178.     Consider the following batch file:
  179.  
  180.         REM
  181.         REM   Check if there's enough memory for the installation
  182.         REM
  183.                 ASET -e -n DUMMY := DISKFREE('C:') gt 1000000
  184.                 IF ERRORLEVEL 1 GOTO OKAY
  185.         ECHO Installation Error
  186.                 ...
  187.  
  188.         The above ASET command will compute the free bytes on drive C: and
  189.         check if the value is larger than 1 Megabyte. If this is so, DUMMY
  190.         is assigned the value 1 (for boolean TRUE), otherwise 0 (boolean
  191.         FALSE). The switch -e makes ASET set the ERRORLEVEL accordingly, ie.
  192.         in this case that ERRORLEVEL will be 1.
  193.  
  194.         You may wonder why I built in the -e facility, because it would also
  195.         have been possible to write
  196.  
  197.                 REM
  198.         REM   Check if there's enough memory for the installation
  199.         REM
  200.                 ASET DUMMY := DISKFREE('C:') gt 1000000
  201.                 IF %DUMMY%==1 GOTO OKAY
  202.         ECHO Installation Error
  203.                 ...
  204.  
  205.         The problem with this is, however, that you assign a new shell variable
  206.         which may cause problems, (a) because you cannot be sure that the name
  207.         of the variable has already been used in the current environment (which
  208.         will result in a loss of the previous value) and, (b) if you invoke the
  209.         above batch file in a subshell, there is likely no more space in the
  210.         system environment table for a new variable. -e is the solution to both
  211.         problems.
  212.  
  213.   -n    ASET will not modify the environment. It only calculates the result
  214.         and displays it, if -e is not specified. If -e is specified together
  215.         with -n, nothing is displayed (unless you force it with -p, of course).
  216.         -n is useful if you want to use ASET as a calculator only or if you
  217.         want ASET to set the ERRORLEVEL without modifying any environment
  218.         variables.
  219.  
  220.   -p    ASET will show the result on standard output in addition to modifying
  221.         the environment.
  222.  
  223.   -r    ASET will repeat the assignment on standard output before actually
  224.       executing it. This eases debugging in file mode.
  225.  
  226.  
  227. 2   Caveats and workarounds
  228. ---------------------------
  229.   Please note that ASET does not accept combined options. If you want to
  230.   specify eg. both -e and -n (which means, that ASET does ONLY set the
  231.   ERRORLEVEL), you must invoke "ASET -e -n", not "ASET -en". The reason for
  232.   this behaviour is the fact that ASET parses the command line two times,
  233.   first for options and arguments, then for the command to be processed.
  234.   Between these two phases, ASET removes the options from the command line
  235.   (and it's much easier to remove single options than combined ones...).
  236.  
  237.   The above parsing algorithm shows another possible problem of ASET. Consider
  238.   an assignment
  239.  
  240.         ASET A := -*
  241.  
  242.   which should assign the string "-*" to A. The reality is different, however.
  243.   You know, what happens, don't you? -* is treated as an option (debug mode).
  244.   After setting debug=true, -* is removed from the command line and
  245.  
  246.         ASET A :=
  247.  
  248.   remains, which will remove A from the list of environment variables. To
  249.   avoid this, you should always obey the following rule:
  250.  
  251.       +-----------------------------------------------------------+
  252.       | ALL STRING VALUES PASSED TO ASET SHOULD BE QUOTED USING ' |
  253.       +-----------------------------------------------------------+
  254.  
  255.   According to this rule, you should better invoke ASET like
  256.  
  257.         ASET A := '-*'
  258.  
  259.   which will do what you (hopefully :-)) want. Quoting strings avoids another
  260.   possible trap. Non-quoted strings are checked against a table which contains
  261.   all of ASETs function names, like SIN, COS, or whatever. Consider the
  262.   following situation in a batch file:
  263.  
  264.         ASET A := fdir(fexpand('.'))
  265.         ASET B := 'D:\MYDIR' + %A%
  266.  
  267.   The first assignment assigns A the name of the current directory without
  268.   the full path. The second assignment is supposed to assign B the value
  269.   "D:\MYDIR\dirname", with dirname being the above result. This will normally
  270.   be ok, but there are about 150 cases in which it will fail, namely whenever
  271.   dirname is one of ASETs function names, eg. SIN or COS. In these cases ASET
  272.   will try to evaluate the function, and in this case fail because of missing
  273.   arguments. Therefore, keeping the 'golden rule' in mind, the correct way is:
  274.  
  275.         ASET A := fdir(fexpand('.'))
  276.         ASET B := 'D:\MYDIR' + '%A%'
  277.  
  278.  
  279. 3   The parser
  280. --------------
  281.   ASET uses Lex and Yacc for Turbo Pascal (Version 2.0 by Albert Graef) to
  282.   scan and parse the input.
  283.  
  284.   It's hard to describe the details of the parser in other words than lex's
  285.   and yacc's :-). Therefore I simply include the specifications here for
  286.   anybody who is interested in the details.
  287.  
  288.   ---------------------------------------------------------------------------
  289.   special         [-+*/%(),!<>=^']
  290.  
  291.   str0            [^-+*/%(),!<>=^' \t\n]+
  292.   str1            '[^'\n]*'
  293.  
  294.   %%
  295.  
  296.   ^#.*            ;
  297.  
  298.   ":="            return(T_ASSIGN);
  299.   "**"            return(ord('^'));
  300.   "div"           return(ord(T_DIV));
  301.   "mod"           return(ord('%'));
  302.  
  303.   "and"           return(T_AND);
  304.   "or"            return(T_OR);
  305.   "nand"          return(T_NAND);
  306.   "nor"           return(T_NOR);
  307.   "xor"           return(T_XOR);
  308.   "not"           return(T_NOT);
  309.  
  310.   "!="            return(T_NE);
  311.   "=="            return(ord('='));
  312.   "ne"            return(T_NE);
  313.   "eq"            return(ord('='));
  314.   "lt"            return(ord('<'));
  315.   "gt"            return(ord('>'));
  316.   "le"            return(T_LE);
  317.   "ge"            return(T_GE);
  318.  
  319.   ^{str0}         begin
  320.                     { the first value will never be treated as a function,
  321.                       because it is always the target of an assignment }
  322.                     Passign(yylval.strg,yytext);
  323.                     return(T_VALUE)
  324.                   end;
  325.  
  326.   {str0}          begin
  327.                     if (lookup(yytext,yylval.func)) then
  328.                       return(T_FUNCTION)
  329.                     else begin
  330.                       Passign(yylval.strg,yytext);
  331.                       return(T_VALUE)
  332.                     end
  333.                   end;
  334.  
  335.   {str1}          begin
  336.                     Passign(yylval.strg,copy(yytext,2,yyleng-2));
  337.                     return(T_VALUE)
  338.                   end;
  339.  
  340.   [ \t]+          ;
  341.   {special}       return(ord(yytext[1]));
  342.   \n              return(ord(yytext[1]));
  343.  
  344.   %%
  345.   ---------------------------------------------------------------------------
  346.   %union {
  347.     case boolean of
  348.       false: (func: integer);
  349.       true:  (strg: Pstrg);
  350.     }
  351.  
  352.   %token <strg> T_VALUE
  353.   %type  <strg> expr
  354.   %type  <strg> optexpr
  355.   %token <func> T_FUNCTION
  356.   %token T_ASSIGN
  357.   %left  T_AND T_OR T_NAND T_NOR T_XOR
  358.   %left  '=' T_NE '<' T_LE '>' T_GE
  359.   %left  '+' '-'
  360.   %left  '^' '*' '/' '%' T_DIV
  361.   %right T_UMINUS T_UNOT
  362.   %token T_NOT
  363.  
  364.   %%
  365.  
  366.   input   : /* empty */
  367.           | T_VALUE assop expr
  368.           | T_VALUE assop
  369.           | T_VALUE
  370.           | error
  371.           ;
  372.  
  373.   assop   : T_ASSIGN
  374.           | '='
  375.           ;
  376.  
  377.   expr    : expr '+' expr                 
  378.           | expr '-' expr                 
  379.           | expr '*' expr                 
  380.           | expr '/' expr                 
  381.           | expr '%' expr                 
  382.           | expr '^' expr                 
  383.           | expr T_DIV expr               
  384.           | expr '=' expr                 
  385.           | expr '<' expr                 
  386.           | expr '>' expr                 
  387.           | expr T_NE expr                
  388.           | expr T_LE expr                
  389.           | expr T_GE expr                
  390.           | expr T_AND expr               
  391.           | expr T_OR expr                
  392.           | expr T_NAND expr              
  393.           | expr T_NOR expr               
  394.           | expr T_XOR expr               
  395.           | '(' expr ')'                  
  396.           | T_NOT expr %prec T_UNOT       
  397.           | '-' expr %prec T_UMINUS       
  398.           | T_VALUE                       
  399.           | T_VALUE T_VALUE               
  400.           | T_FUNCTION optpars            
  401.           ;
  402.  
  403.   optpars : /* empty */
  404.           | '(' parlist ')'
  405.           ;
  406.  
  407.   parlist : optexpr
  408.           | parlist "," optexpr
  409.           ;
  410.  
  411.   optexpr : /* empty */
  412.           | expr
  413.           ;
  414.  
  415.   %%
  416.   ---------------------------------------------------------------------------
  417.  
  418.  
  419. 4   The type concept in ASET
  420. ----------------------------
  421.   ASET has a variable built-in type concept. It is based on the fact that
  422.   each value can be interpreted in different ways, according to the underlying
  423.   basic data types. There are four basic data types, with the given semantics:
  424.  
  425.         String          Each value is a string
  426.         Real            Some strings are real numbers
  427.         Integer         Some reals are integers
  428.         Boolean         Some integers are booleans
  429.  
  430.   Consider some examples:
  431.  
  432.         'Auto'          is a string, no real, no integer, no boolean
  433.         '1.4e-1'        is a string, a real, no integer, no boolean
  434.         '100'           is a string, a real, an integer, no boolean
  435.         '1'             is a string, a real, an integer, a boolean (true)
  436.         ''        is a string, no real, no integer, no boolean
  437.  
  438.   The definition of valid reals and integers is the usual one. Note that they
  439.   are always unsigned, because the - is treated as an operator (unary -). The
  440.   definition of boolean values is:
  441.  
  442.         0       represents the value false
  443.         1       represents the value true
  444.  
  445.   Now we head towards an extension of this type concept: Consider the value
  446.   '1.4e-1' again. We can interpret this value as an integer by applying the
  447.   function 'round' to it, which makes it an integer 0. In a similar way we
  448.   define each integer to be a boolean value by applying the function 'signum',
  449.   which means: boolean is false, if integer is zero, and true, if integer is
  450.   not zero. Let's return to our example and show all possible interpretations:
  451.  
  452.         String value    Real    Integer Boolean
  453.         'Auto'          0.0     0       false
  454.         '1.4e-1'        0.14    0       false
  455.         '100'           100.0   100     true
  456.         '1'             1.0     1       true
  457.         ''        0.0    0    false
  458.         '0.5'           0.5     1       true
  459.  
  460.   The last entry shows the effect of the 'round' function which returns the
  461.   nearest integer and, if the number lies between two integers, takes the
  462.   larger one.
  463.  
  464.   ASET will automagically choose the strongest lossless representation for the
  465.   results of operations. That means, that the result of '0.5'+'0.5' is inter-
  466.   preted as '1', ie. an integer value, not '1.0', a real value.
  467.  
  468.  
  469. 5   Intrinsic operators
  470. -----------------------
  471.   The following operators are built-in (I will call them 'intrinsic' from now
  472.   on in contrast to the 'functions'). They are discussed in detail now.
  473.  
  474.   +             The + operator adds its arguments, if they are real numbers.
  475.                 If at least one string takes part in the operation, a con-
  476.                 catenation is performed. Some examples
  477.  
  478.                         1+1                     2
  479.                         1.5+1                   2.5
  480.                         1+'a'                   '1a'
  481.                         'abc'+'def'             'abcdef'
  482.                         'a '+' b'               'a  b'
  483.                         '+'+'+'            ++
  484.  
  485.   -             The - operator subtracts its arguments, if they are real
  486.                 numbers. If at least one string takes part in the operation,
  487.                 a replacement is performed. If the statement is s1-s2, all
  488.                 occurences of s2 in s1 are removed. Some examples:
  489.  
  490.                         1-1                     0
  491.                         1.5-1                   0.5
  492.                         1-'a'                   1
  493.                         'abc aba'-a             'bc b'
  494.                         '-'-'-'            ''
  495.  
  496.   *             This operator multiplies its arguments, if they are numbers,
  497.                 otherwise '?' is returned. Some examples:
  498.  
  499.                         1*1                     1
  500.                         1.5*2.5                 3.75
  501.                         1*'a'                   ?
  502.                         'abc'*' '               ?
  503.  
  504.   /             divides the arguments, if they are both numbers. If one of the
  505.                 arguments is not a number, or if the second number is zero, '?'
  506.                 is returned. Examples:
  507.  
  508.                         1/1                     1
  509.                         1.5/2.5                 0.6
  510.                         1/'a'                   ?
  511.                         'abc'/' '               ?
  512.  
  513.   div           performs an integer division of the arguments. If one of them
  514.                 is not a number or the second argument is zero, '?' is returned.
  515.                 Note that reals are rounded according to ASETs type concept.
  516.  
  517.                         1 div 1                 1
  518.                         10 div 3                3
  519.                         10.5 div 3.1            3       (= 11 div 3)
  520.                         10.5 div 3.5            2       (= 11 div 4)
  521.                         100a div 100            ?
  522.                         'ab' div ' '        ?
  523.  
  524.   mod, %        apply the mod function to the arguments. If one of them is
  525.                 not a number or the second argument is zero, '?' is returned.
  526.                 Note that reals are rounded according to ASETs type concept.
  527.                 The '%' character is interpreted as a shell variable reference
  528.                 in most DOS versions. Therefore you must use '%%' (or div, of
  529.                 course) there. Some examples:
  530.  
  531.                         1%1                     0
  532.                         10 mod 3                1
  533.                         10.5 mod 3.1            2       (= 11 mod 3)
  534.                         10.5%3.5                3       (= 11 mod 4)
  535.                         100a%100                ?
  536.                         'ab'%' '        ?
  537.  
  538.   ^, **        raise the first argument to the power of the second. These
  539.           operators determine whether the exponent is integer or not and
  540.                 choose the most efficient algorithm for the computation. They
  541.                 return '?' if at least one non-real is involved or an error
  542.                 occurs. An error occurs if the exponent is not an integer and
  543.                 the first argument is less than zero. Examples:
  544.  
  545.                     2^3            8
  546.                         2.5^2            6.25
  547.                         9**0.5            3
  548.                         -1^2            1
  549.                         -1^2.5            ?
  550.                         a^1            ?
  551.                         abc^' '            ?
  552.  
  553.   eq, =, ==    test if the arguments are equal. The equality is checked in a
  554.         different way for the different data types. If both arguments
  555.                 are integers, the numbers are checked. If both are reals, the
  556.                 numbers are checked using a built-in constant EPS (whose value
  557.                 is returned by the generic function EPS). The check which is
  558.                 performed, is "abs(r1-r2)<EPS", ie. the so-called absolute
  559.                 error is checked. For strings the check is about literal
  560.                 equality (each character must correspond).
  561.         The return value is boolean, ie. 1, if true, 0, if false.
  562.         Some examples:
  563.  
  564.                     9==09            1    (integers)
  565.                         '9'=='09'        1    (still integers)
  566.                         'a'=='A'        0    (case is relevent)
  567.                         'a bc'='a bc'        1    (of course)
  568.             1.2 eq 1.3        0    (EPS is not THAT big)
  569.                         1.2 eq 1.20000001    1    (big enough for this)
  570.  
  571.   ne, !=    The opposite of eq, making the same assumptions. Examples:
  572.  
  573.                     9!=09            0
  574.                         '9'!='09'        0
  575.                         'a'!='A'        1
  576.                         'a bc'!='a bc'        0
  577.             1.2 ne 1.3        1
  578.                         1.2 ne 1.20000001    0
  579.  
  580.   lt, gt, le, ge
  581.           Self explanatory.
  582.  
  583.   and, or, nand, nor, xor
  584.           are the logical operators. Their meaning is defined in two
  585.                 different ways, depending on the type of the arguments. If
  586.                 both are boolean, the result is computed as if the values
  587.                 true and false took part in the operation. If both are
  588.                 integer (which includes one integer and one boolean), the
  589.                 arguments are processed bitwise. Real numbers and strings
  590.                 result in '?'. Some examples:
  591.  
  592.                     1 and 1            1 (boolean)
  593.                         1 and 2            0 (integer)
  594.                         1 and 3                 1 (integer)
  595.                         a and 1            ?
  596.                         1.2 and 0        ?
  597.  
  598.  
  599. 6   Functions
  600. -------------
  601.   ASET has a lot of built-in functions whose syntax is always
  602.  
  603.         function(arg1,arg2,...)
  604.  
  605.   or, in the cases of missing arguments, simply
  606.  
  607.         function
  608.  
  609.   Examples for function calls are
  610.  
  611.         ASET A = min(-100,3,10)         # A = -100
  612.         ASET A = int(-3.4)              # A = -3
  613.         ASET A = sin(pi)                # A = 0; note the 2 function sin, pi
  614.         ASET A = pi                     # A = 3.141593
  615.         ASET A = line(1,'FOO.DAT')      # A = <line 1 of FOO.DAT>
  616.         ASET A = getstr(10)             # A = <you must input a string>
  617.  
  618.   The next part of the documentation is generated automatically. It might
  619.   therefore be boring to read it :-) I recommend you use mainly the quick
  620.   reference, because the examples give a good overview, I believe.
  621.  
  622.   Refer to the last section, "Details", if you wonder how the functions work
  623.   internally (that section is _not_ generated automatically).
  624.  
  625.  
  626.  
  627. 7   Overview over ASETs functions
  628. =================================
  629.  
  630. 7.1   Alphabetic list of ASETs functions
  631. ----------------------------------------
  632.    abs acos acosd aif arccos arccosd arcsin arcsind arctan arctand args
  633.    arithif asc asin asind atan atand bootdrive bootdrv buffers char chr
  634.    concat copy cos cosd cosh count country date day dayofyear delete device
  635.    dfree dir diskfree disksize dospath dosver doy dsize e envcnt envcount
  636.    envused eps even exp fac fattr fcbsx fcbsy fdate fdir fdrive fexpand fext
  637.    fileattr filedate filedir filedrive fileext filename filenamex filepath
  638.    files filesize filetime fname fnamex fpath frac fsize ftime fullpath
  639.    getkey getline getnum getnumber getstr getstring hour if instr int isdir
  640.    key label lastdrive lastdrv leap leapyear left leftstr len length line ln
  641.    locase log lower max memfree mid min minute month monthn monthname nth
  642.    ntharg odd ord pi pick pickarg pos quote ramfree random right rightstr
  643.    rnd round second sgn shell sign sin sind sinh sqr sqrt stackx stacky
  644.    suball subst substall substone tan tand tanh time tmpname today trunc
  645.    type unique unquote upcase upper volume wday wdayn wdayname words year
  646.  
  647. 7.2   List of ASETs functions, sorted by categories
  648. ---------------------------------------------------
  649. Math functions:
  650.    abs acos acosd arccos arccosd arcsin arcsind arctan arctand asin asind
  651.    atan atand cos cosd cosh e eps even exp fac frac int ln log odd pi random
  652.    rnd round sgn sign sin sind sinh sqr sqrt tan tand tanh trunc
  653. Functions returning information about files and disks:
  654.    dfree dir diskfree disksize dospath dsize fattr fdate fdir fdrive fexpand
  655.    fext fileattr filedate filedir filedrive fileext filename filenamex
  656.    filepath filesize filetime fname fnamex fpath fsize ftime fullpath isdir
  657.    label tmpname unique volume
  658. Functions accessing CONFIG.SYS:
  659.    buffers country device fcbsx fcbsy files lastdrive lastdrv shell stackx
  660.    stacky
  661. String handling:
  662.    asc char chr concat copy count delete instr left leftstr len length
  663.    locase lower mid nth ord pick pos quote right rightstr suball subst
  664.    substall substone unquote upcase upper words
  665. User and file interaction functions:
  666.    getkey getline getnum getnumber getstr getstring key line
  667. Time/date handling:
  668.    date day dayofyear doy hour leap leapyear minute month monthn monthname
  669.    second time today wday wdayn wdayname year
  670. Miscellanous functions:
  671.    aif args arithif bootdrive bootdrv dosver envcnt envcount envused if max
  672.    memfree min ntharg pickarg ramfree type
  673.  
  674.  
  675.  
  676. 8   Documentation of ASETs functions
  677. ====================================
  678.  
  679. -------------------------------------------------------------------------------
  680. ABS - Calculates the absolute value
  681. -------------------------------------------------------------------------------
  682.    Argument(s): 1, Real 
  683.    Result type: Real 
  684.    Category   : Math functions
  685.  
  686.    Example: 
  687.      C:> ASET -p X := ABS(-5.56)
  688.      X=5.56
  689.  
  690.  
  691. -------------------------------------------------------------------------------
  692. AIF - Arithmetic IF, returns arg2, if arg1<0, returns arg3, if arg1=0, returns
  693.       arg4 else
  694. -------------------------------------------------------------------------------
  695.    Argument(s): 4, Real String String String 
  696.    Result type: String 
  697.    Aliases    : ARITHIF
  698.    See also   : IF
  699.    Category   : Miscellanous functions
  700.  
  701.    Example: 
  702.      C:> ASET -p X := AIF(0.5,'a','b','c')
  703.      X=c
  704.  
  705.  
  706. -------------------------------------------------------------------------------
  707. ARCCOS - Computes the radiant arcus cosinus
  708. -------------------------------------------------------------------------------
  709.    Argument(s): 1, Real 
  710.    Result type: Real 
  711.    Aliases    : ACOS
  712.    See also   : ARCCOSD ACOSD
  713.    Category   : Math functions
  714.  
  715.    Example: 
  716.      C:> ASET -p X := ARCCOS(0.5)
  717.      X=1.047198
  718.  
  719.  
  720. -------------------------------------------------------------------------------
  721. ARCCOSD - Computes the degree arcus cosinus
  722. -------------------------------------------------------------------------------
  723.    Argument(s): 1, Real 
  724.    Result type: Real 
  725.    Aliases    : ACOSD
  726.    See also   : ARCCOS ACOS
  727.    Category   : Math functions
  728.  
  729.    Example: 
  730.      C:> ASET -p X := ARCCOSD(0.5)
  731.      X=60
  732.  
  733.  
  734. -------------------------------------------------------------------------------
  735. ARCSIN - Computes the radiant arcus sinus
  736. -------------------------------------------------------------------------------
  737.    Argument(s): 1, Real 
  738.    Result type: Real 
  739.    Aliases    : ASIN
  740.    See also   : ARCSIND ASIND
  741.    Category   : Math functions
  742.  
  743.    Example: 
  744.      C:> ASET -p X := ARCSIN(0.5)
  745.      X=0.523599
  746.  
  747.  
  748. -------------------------------------------------------------------------------
  749. ARCSIND - Computes the degree arcus sinus
  750. -------------------------------------------------------------------------------
  751.    Argument(s): 1, Real 
  752.    Result type: Real 
  753.    Aliases    : ASIND
  754.    See also   : ARCSIN ASIN
  755.    Category   : Math functions
  756.  
  757.    Example: 
  758.      C:> ASET -p X := ARCSIND(0.5)
  759.      X=30
  760.  
  761.  
  762. -------------------------------------------------------------------------------
  763. ARCTAN - Computes the radiant arcus tangens
  764. -------------------------------------------------------------------------------
  765.    Argument(s): 1, Real 
  766.    Result type: Real 
  767.    Aliases    : ATAN
  768.    See also   : ARCTAND ATAND
  769.    Category   : Math functions
  770.  
  771.    Example: 
  772.      C:> ASET -p X := ARCTAN(0.5)
  773.      X=0.463648
  774.  
  775.  
  776. -------------------------------------------------------------------------------
  777. ARCTAND - Computes the degree arcus tangens
  778. -------------------------------------------------------------------------------
  779.    Argument(s): 1, Real 
  780.    Result type: Real 
  781.    Aliases    : ATAND
  782.    See also   : ARCTAN ATAN
  783.    Category   : Math functions
  784.  
  785.    Example: 
  786.      C:> ASET -p X := ARCTAND(0.5)
  787.      X=26.565051
  788.  
  789.  
  790. -------------------------------------------------------------------------------
  791. ARGS - Returns the number of arguments in a list
  792. -------------------------------------------------------------------------------
  793.    Argument(s): from 0 to 64, String 
  794.    Result type: Integer 
  795.    See also   : WORDS
  796.    Category   : Miscellanous functions
  797.  
  798.    Example: 
  799.      C:> ASET -p X := ARGS(2,'Ricki',1.4)
  800.      X=3
  801.  
  802.  
  803. -------------------------------------------------------------------------------
  804. BOOTDRV - Determines from which drive the system was booted, needs DOS 4++ ('?'
  805.           on error)
  806. -------------------------------------------------------------------------------
  807.    Argument(s): None
  808.    Result type: String 
  809.    Aliases    : BOOTDRIVE
  810.    Category   : Miscellanous functions
  811.  
  812.    Example: 
  813.      C:> ASET -p X := BOOTDRV
  814.      X=C:
  815.  
  816.  
  817. -------------------------------------------------------------------------------
  818. BUFFERS - Returns BUFFERS or HIBUFFERS from CONFIG.SYS (15 on error)
  819. -------------------------------------------------------------------------------
  820.    Argument(s): None
  821.    Result type: Integer 
  822.    Category   : Functions accessing CONFIG.SYS
  823.  
  824.    Example: 
  825.      C:> ASET -p X := BUFFERS
  826.      X=20
  827.  
  828.  
  829. -------------------------------------------------------------------------------
  830. CHR - Returns the character with the given ASCII code (? on error)
  831. -------------------------------------------------------------------------------
  832.    Argument(s): 1, Integer 
  833.    Result type: String 
  834.    Aliases    : CHAR
  835.    See also   : ORD
  836.    Category   : String handling
  837.  
  838.    Example: 
  839.      C:> ASET -p X := CHR(65)
  840.      X=A
  841.  
  842.  
  843. -------------------------------------------------------------------------------
  844. CONCAT - Returns the concatenation of the arguments
  845. -------------------------------------------------------------------------------
  846.    Argument(s): from 1 to 64, String 
  847.    Result type: String 
  848.    Category   : String handling
  849.  
  850.    Example: 
  851.      C:> ASET -p X := CONCAT(1,1,'a')
  852.      X=11a
  853.  
  854.  
  855. -------------------------------------------------------------------------------
  856. COPY - Returns a substring of a string (arguments are: string,start,length)
  857. -------------------------------------------------------------------------------
  858.    Argument(s): 3, String Integer Integer 
  859.    Result type: String 
  860.    Aliases    : MID
  861.    See also   : DELETE
  862.    Category   : String handling
  863.  
  864.    Example: 
  865.      C:> ASET -p X := COPY('ABCDE',3,2)
  866.      X=CD
  867.  
  868.  
  869. -------------------------------------------------------------------------------
  870. COS - Computes the radiant cosinus function
  871. -------------------------------------------------------------------------------
  872.    Argument(s): 1, Real 
  873.    Result type: Real 
  874.    See also   : COSD
  875.    Category   : Math functions
  876.  
  877.    Example: 
  878.      C:> ASET -p X := COS(3.1415926535)
  879.      X=-1
  880.  
  881.  
  882. -------------------------------------------------------------------------------
  883. COSD - Computes the degree cosinus function
  884. -------------------------------------------------------------------------------
  885.    Argument(s): 1, Real 
  886.    Result type: Real 
  887.    See also   : COS
  888.    Category   : Math functions
  889.  
  890.    Example: 
  891.      C:> ASET -p X := COSD(90)
  892.      X=0
  893.  
  894.  
  895. -------------------------------------------------------------------------------
  896. COSH - Computes the cosinus hyperbolicus function
  897. -------------------------------------------------------------------------------
  898.    Argument(s): 1, Real 
  899.    Result type: Real 
  900.    Category   : Math functions
  901.  
  902.    Example: 
  903.      C:> ASET -p X := COSH(1)
  904.      X=1.543081
  905.  
  906.  
  907. -------------------------------------------------------------------------------
  908. COUNTRY - Returns the country code from CONFIG.SYS (001 on error)
  909. -------------------------------------------------------------------------------
  910.    Argument(s): None
  911.    Result type: Integer 
  912.    Category   : Functions accessing CONFIG.SYS
  913.  
  914.    Example: 
  915.      C:> ASET -p X := COUNTRY
  916.      X=049
  917.  
  918.  
  919. -------------------------------------------------------------------------------
  920. DATE - Returns the current date in the form MM/DD/YYYY
  921. -------------------------------------------------------------------------------
  922.    Argument(s): None
  923.    Result type: String 
  924.    Aliases    : TODAY
  925.    Category   : Time/date handling
  926.  
  927.    Example: 
  928.      C:> ASET -p X := DATE
  929.      X='06/21/1992'
  930.  
  931.  
  932. -------------------------------------------------------------------------------
  933. DAY - Determines the day in a month for a given date (default is today) (? on
  934.       error)
  935. -------------------------------------------------------------------------------
  936.    Argument(s): from 0 to 1, String 
  937.    Result type: String 
  938.    Category   : Time/date handling
  939.  
  940.    Example: 
  941.      C:> ASET -p X := DAY('12/04/1992')
  942.      X=4
  943.  
  944.  
  945. -------------------------------------------------------------------------------
  946. DELETE - Deletes a substring from a string (arguments are: string,start,length)
  947. -------------------------------------------------------------------------------
  948.    Argument(s): 3, String Integer Integer 
  949.    Result type: String 
  950.    See also   : COPY
  951.    Category   : String handling
  952.  
  953.    Example: 
  954.      C:> ASET -p X := DELETE('ABCDE',3,2)
  955.      X=ABE
  956.  
  957.  
  958. -------------------------------------------------------------------------------
  959. DEVICE - Returns the number of the line in CONFIG.SYS which contains the line
  960.          'DEVICE='argument (0 if none)
  961. -------------------------------------------------------------------------------
  962.    Argument(s): 1, String 
  963.    Result type: Integer 
  964.    Category   : Functions accessing CONFIG.SYS
  965.  
  966.    Example: 
  967.      C:> ASET -p X := DEVICE('VDISK.SYS')
  968.      X=5
  969.  
  970.  
  971. -------------------------------------------------------------------------------
  972. DFREE - Returns the free bytes on a the current drive (default is the current
  973.         drive)
  974. -------------------------------------------------------------------------------
  975.    Argument(s): from 0 to 1, String 
  976.    Result type: String 
  977.    Aliases    : DISKFREE
  978.    Category   : Functions returning information about files and disks
  979.  
  980.    Example: 
  981.      C:> ASET -p X := DFREE('C:')
  982.      X=2654322
  983.  
  984.  
  985. -------------------------------------------------------------------------------
  986. DIR - Returns the current directory on a drive (default is the current drive)
  987. -------------------------------------------------------------------------------
  988.    Argument(s): from 0 to 1, String 
  989.    Result type: String 
  990.    Category   : Functions returning information about files and disks
  991.  
  992.    Example: 
  993.      C:> ASET -p X := DIR('A:')
  994.      X=A:\
  995.  
  996.  
  997. -------------------------------------------------------------------------------
  998. DOSPATH - Locates a file in PATH and returns its full path
  999. -------------------------------------------------------------------------------
  1000.    Argument(s): 1, String 
  1001.    Result type: String 
  1002.    Category   : Functions returning information about files and disks
  1003.  
  1004.    Example: 
  1005.      C:> ASET -p X := DOSPATH('SORT.EXE')
  1006.      X=C:\DOS\SORT.EXE
  1007.  
  1008.  
  1009. -------------------------------------------------------------------------------
  1010. DOSVER - Returns the DOS version
  1011. -------------------------------------------------------------------------------
  1012.    Argument(s): None
  1013.    Result type: String 
  1014.    Category   : Miscellanous functions
  1015.  
  1016.    Example: 
  1017.      C:> ASET -p X := DOSVER
  1018.      X=3.30
  1019.  
  1020.  
  1021. -------------------------------------------------------------------------------
  1022. DOY - Returns the day in a year for a given date (default is today)
  1023. -------------------------------------------------------------------------------
  1024.    Argument(s): from 0 to 1, String 
  1025.    Result type: Integer 
  1026.    Aliases    : DAYOFYEAR
  1027.    Category   : Time/date handling
  1028.  
  1029.    Example: 
  1030.      C:> ASET -p X := DOY()
  1031.      X=135
  1032.  
  1033.  
  1034. -------------------------------------------------------------------------------
  1035. DSIZE - Returns the capacity of a drive (default is the current drive)
  1036. -------------------------------------------------------------------------------
  1037.    Argument(s): from 0 to 1, String 
  1038.    Result type: String 
  1039.    Aliases    : DISKSIZE
  1040.    Category   : Functions returning information about files and disks
  1041.  
  1042.    Example: 
  1043.      C:> ASET -p X := DSIZE('B:')
  1044.      X=1457664
  1045.  
  1046.  
  1047. -------------------------------------------------------------------------------
  1048. E - The Euler constant
  1049. -------------------------------------------------------------------------------
  1050.    Argument(s): None
  1051.    Result type: Real 
  1052.    Category   : Math functions
  1053.  
  1054.    Example: 
  1055.      C:> ASET -p X := E
  1056.      X=2.718282
  1057.  
  1058.  
  1059. -------------------------------------------------------------------------------
  1060. ENVCNT - Determines the number of shell variables set (the current one has no
  1061.          effect)
  1062. -------------------------------------------------------------------------------
  1063.    Argument(s): None
  1064.    Result type: Integer 
  1065.    Aliases    : ENVCOUNT
  1066.    Category   : Miscellanous functions
  1067.  
  1068.    Example: 
  1069.      C:> ASET -p X := ENVCNT
  1070.      X=10
  1071.  
  1072.  
  1073. -------------------------------------------------------------------------------
  1074. ENVUSED - Determines the number of bytes used by shell vars (the current one
  1075.           has no effect)
  1076. -------------------------------------------------------------------------------
  1077.    Argument(s): None
  1078.    Result type: Integer 
  1079.    Category   : Miscellanous functions
  1080.  
  1081.    Example: 
  1082.      C:> ASET -p X := ENVUSED
  1083.      X=876
  1084.  
  1085.  
  1086. -------------------------------------------------------------------------------
  1087. EPS - Returns the constant EPS, which ASET uses to classify two real numbers as
  1088.       equal
  1089. -------------------------------------------------------------------------------
  1090.    Argument(s): None
  1091.    Result type: Real 
  1092.    Category   : Math functions
  1093.  
  1094.    Example: 
  1095.      C:> ASET -p X := EPS
  1096.      X=0.00001
  1097.  
  1098.  
  1099. -------------------------------------------------------------------------------
  1100. EVEN - Determines whether the argument is an even integer number
  1101. -------------------------------------------------------------------------------
  1102.    Argument(s): 1, Integer 
  1103.    Result type: Boolean 
  1104.    See also   : ODD
  1105.    Category   : Math functions
  1106.  
  1107.    Example: 
  1108.      C:> ASET -p X := EVEN(2)
  1109.      X=1
  1110.  
  1111.  
  1112. -------------------------------------------------------------------------------
  1113. EXP - Computes the exp function
  1114. -------------------------------------------------------------------------------
  1115.    Argument(s): 1, Real 
  1116.    Result type: Real 
  1117.    See also   : LN
  1118.    Category   : Math functions
  1119.  
  1120.    Example: 
  1121.      C:> ASET -p X := EXP(1)
  1122.      X=2.718282
  1123.  
  1124.  
  1125. -------------------------------------------------------------------------------
  1126. FAC - Compute the faculty function
  1127. -------------------------------------------------------------------------------
  1128.    Argument(s): 1, Integer 
  1129.    Result type: Integer 
  1130.    Category   : Math functions
  1131.  
  1132.    Example: 
  1133.      C:> ASET -p X := FAC(5)
  1134.      X=120
  1135.  
  1136.  
  1137. -------------------------------------------------------------------------------
  1138. FATTR - Returns a string representing the attributes of a file
  1139. -------------------------------------------------------------------------------
  1140.    Argument(s): 1, String 
  1141.    Result type: String 
  1142.    Aliases    : FILEATTR
  1143.    Category   : Functions returning information about files and disks
  1144.  
  1145.    Example: 
  1146.      C:> ASET -p X := FATTR('C:\IBMBIO.COM')
  1147.      X=rhsa
  1148.  
  1149.  
  1150. -------------------------------------------------------------------------------
  1151. FCBSX - Returns the number of contemporary open files from CONFIG.SYS (4 on
  1152.         error)
  1153. -------------------------------------------------------------------------------
  1154.    Argument(s): None
  1155.    Result type: Integer 
  1156.    Category   : Functions accessing CONFIG.SYS
  1157.  
  1158.    Example: 
  1159.      C:> ASET -p X := FCBSX
  1160.      X=4
  1161.  
  1162.  
  1163. -------------------------------------------------------------------------------
  1164. FCBSY - Returns the minimum number of kept-open files from CONFIG.SYS (0 on
  1165.         error)
  1166. -------------------------------------------------------------------------------
  1167.    Argument(s): None
  1168.    Result type: Integer 
  1169.    Category   : Functions accessing CONFIG.SYS
  1170.  
  1171.    Example: 
  1172.      C:> ASET -p X := FCBSY
  1173.      X=0
  1174.  
  1175.  
  1176. -------------------------------------------------------------------------------
  1177. FDATE - Returns the last modification date of a file (MM/DD/YYYY)
  1178. -------------------------------------------------------------------------------
  1179.    Argument(s): 1, String 
  1180.    Result type: String 
  1181.    Aliases    : FILEDATE
  1182.    Category   : Functions returning information about files and disks
  1183.  
  1184.    Example: 
  1185.      C:> ASET -p X := FDATE('A.EXE')
  1186.      X=06/21/1992
  1187.  
  1188.  
  1189. -------------------------------------------------------------------------------
  1190. FDIR - Returns the name of the deepest directory in a path
  1191. -------------------------------------------------------------------------------
  1192.    Argument(s): from 0 to 1, String 
  1193.    Result type: String 
  1194.    Aliases    : FILEDIR
  1195.    Category   : Functions returning information about files and disks
  1196.  
  1197.    Example: 
  1198.      C:> ASET -p X := FDIR('A:\BIN\B.BAT')
  1199.      X=BIN
  1200.  
  1201.  
  1202. -------------------------------------------------------------------------------
  1203. FDRIVE - Extracts the drive specification from a path
  1204. -------------------------------------------------------------------------------
  1205.    Argument(s): from 0 to 1, String 
  1206.    Result type: String 
  1207.    Aliases    : FILEDRIVE
  1208.    Category   : Functions returning information about files and disks
  1209.  
  1210.    Example: 
  1211.      C:> ASET -p X := FDRIVE('A:\BIN\B.BAT')
  1212.      X=A:
  1213.  
  1214.  
  1215. -------------------------------------------------------------------------------
  1216. FEXPAND - Returns the full path to a file
  1217. -------------------------------------------------------------------------------
  1218.    Argument(s): 1, String 
  1219.    Result type: String 
  1220.    Aliases    : FULLPATH
  1221.    Category   : Functions returning information about files and disks
  1222.  
  1223.    Example: 
  1224.      C:> ASET -p X := FEXPAND('README.TXT')
  1225.      X=C:\PROGS\ASET\README
  1226.  
  1227.  
  1228. -------------------------------------------------------------------------------
  1229. FEXT - Extracts the extension from a path
  1230. -------------------------------------------------------------------------------
  1231.    Argument(s): 1, String 
  1232.    Result type: String 
  1233.    Aliases    : FILEEXT
  1234.    Category   : Functions returning information about files and disks
  1235.  
  1236.    Example: 
  1237.      C:> ASET -p X := FEXT('A:\BIN\B.BAT')
  1238.      X=.BAT
  1239.  
  1240.  
  1241. -------------------------------------------------------------------------------
  1242. FILES - Returns the maximum number of file handles from CONFIG.SYS
  1243. -------------------------------------------------------------------------------
  1244.    Argument(s): None
  1245.    Result type: Integer 
  1246.    Category   : Functions accessing CONFIG.SYS
  1247.  
  1248.    Example: 
  1249.      C:> ASET -p X := FILES
  1250.      X=20
  1251.  
  1252.  
  1253. -------------------------------------------------------------------------------
  1254. FNAME - Extracts the name from a path
  1255. -------------------------------------------------------------------------------
  1256.    Argument(s): 1, String 
  1257.    Result type: String 
  1258.    Aliases    : FILENAME
  1259.    See also   : FNAMEX
  1260.    Category   : Functions returning information about files and disks
  1261.  
  1262.    Example: 
  1263.      C:> ASET -p X := FNAME('A:\BIN\B.BAT')
  1264.      X=B
  1265.  
  1266.  
  1267. -------------------------------------------------------------------------------
  1268. FNAMEX - Extracts name+extension from a path
  1269. -------------------------------------------------------------------------------
  1270.    Argument(s): 1, String 
  1271.    Result type: String 
  1272.    Aliases    : FILENAMEX
  1273.    See also   : FNAME FEXT
  1274.    Category   : Functions returning information about files and disks
  1275.  
  1276.    Example: 
  1277.      C:> ASET -p X := FNAMEX('A:\BIN\B.BAT')
  1278.      X=B.BAT
  1279.  
  1280.  
  1281. -------------------------------------------------------------------------------
  1282. FPATH - Extracts the directory specification from a path (default is the
  1283.         current directory)
  1284. -------------------------------------------------------------------------------
  1285.    Argument(s): from 0 to 1, String 
  1286.    Result type: String 
  1287.    Aliases    : FILEPATH
  1288.    Category   : Functions returning information about files and disks
  1289.  
  1290.    Example: 
  1291.      C:> ASET -p X := FPATH('A:\BIN\B.BAT')
  1292.      X=A:\BIN\
  1293.  
  1294.  
  1295. -------------------------------------------------------------------------------
  1296. FRAC - Returns the fractional part of a real number
  1297. -------------------------------------------------------------------------------
  1298.    Argument(s): 1, Real 
  1299.    Result type: Real 
  1300.    See also   : INT TRUNC
  1301.    Category   : Math functions
  1302.  
  1303.    Example: 
  1304.      C:> ASET -p X := FRAC(5.56)
  1305.      X=0.56
  1306.  
  1307.  
  1308. -------------------------------------------------------------------------------
  1309. FSIZE - Returns the size of a file in bytes
  1310. -------------------------------------------------------------------------------
  1311.    Argument(s): 1, String 
  1312.    Result type: Integer 
  1313.    Aliases    : FILESIZE
  1314.    Category   : Functions returning information about files and disks
  1315.  
  1316.    Example: 
  1317.      C:> ASET -p X := FSIZE('A:\BIN\B.BAT')
  1318.      X=807
  1319.  
  1320.  
  1321. -------------------------------------------------------------------------------
  1322. FTIME - Returns the last modification date of a file in the format HH:MM.SS
  1323. -------------------------------------------------------------------------------
  1324.    Argument(s): 1, String 
  1325.    Result type: String 
  1326.    Aliases    : FILETIME
  1327.    Category   : Functions returning information about files and disks
  1328.  
  1329.    Example: 
  1330.      C:> ASET -p X := FTIME('A.EXE')
  1331.      X=12:10.01
  1332.  
  1333.  
  1334. -------------------------------------------------------------------------------
  1335. GETKEY - Asks you to press a key from a given key set w/o echo (the default key
  1336.          set is all possible keys)
  1337. -------------------------------------------------------------------------------
  1338.    Argument(s): from 0 to 1, String 
  1339.    Result type: String 
  1340.    Aliases    : KEY
  1341.    Category   : User and file interaction functions
  1342.  
  1343.    Example: 
  1344.      C:> ASET -p X := GETKEY('YyNn')
  1345.      X=Y
  1346.  
  1347.  
  1348. -------------------------------------------------------------------------------
  1349. GETNUM - Asks you to input a real number (arguments are:
  1350.          maxlen,default,row,col)
  1351. -------------------------------------------------------------------------------
  1352.    Argument(s): from 0 to 4, Integer Real Integer Integer 
  1353.    Result type: Real 
  1354.    Aliases    : GETNUMBER
  1355.    Category   : User and file interaction functions
  1356.  
  1357.    Example: 
  1358.      C:> ASET -p X := GETNUM(3,0,1,1)
  1359.      X=123
  1360.  
  1361.  
  1362. -------------------------------------------------------------------------------
  1363. GETSTR - Asks you to input a string (arguments are: maxlen,default,row,col)
  1364. -------------------------------------------------------------------------------
  1365.    Argument(s): from 0 to 4, Integer String Integer Integer 
  1366.    Result type: String 
  1367.    Aliases    : GETSTRING
  1368.    Category   : User and file interaction functions
  1369.  
  1370.    Example: 
  1371.      C:> ASET -p X := GETSTR(3,'AB',1,1)
  1372.      X=ABC
  1373.  
  1374.  
  1375. -------------------------------------------------------------------------------
  1376. HOUR - Returns the system hour
  1377. -------------------------------------------------------------------------------
  1378.    Argument(s): None
  1379.    Result type: Integer 
  1380.    See also   : MINUTE SECOND
  1381.    Category   : Time/date handling
  1382.  
  1383.    Example: 
  1384.      C:> ASET -p X := HOUR
  1385.      X=12
  1386.  
  1387.  
  1388. -------------------------------------------------------------------------------
  1389. IF - Condition IF, returns arg2, if arg1=1, else returns arg3
  1390. -------------------------------------------------------------------------------
  1391.    Argument(s): 3, Boolean String String 
  1392.    Result type: String 
  1393.    See also   : ARITHIF AIF
  1394.    Category   : Miscellanous functions
  1395.  
  1396.    Example: 
  1397.      C:> ASET -p X := IF(1 gt 0,'a','b')
  1398.      X=a
  1399.  
  1400.  
  1401. -------------------------------------------------------------------------------
  1402. INSTR - Returns the position of a substring in a string (arguments are:
  1403.         string,pattern)
  1404. -------------------------------------------------------------------------------
  1405.    Argument(s): 2, String String 
  1406.    Result type: Integer 
  1407.    See also   : POS
  1408.    Category   : String handling
  1409.  
  1410.    Example: 
  1411.      C:> ASET -p X := INSTR('ABCDE','C')
  1412.      X=3
  1413.  
  1414.  
  1415. -------------------------------------------------------------------------------
  1416. INT - Returns the integer part of a real number
  1417. -------------------------------------------------------------------------------
  1418.    Argument(s): 1, Real 
  1419.    Result type: Integer 
  1420.    Aliases    : TRUNC
  1421.    See also   : FRAC ROUND
  1422.    Category   : Math functions
  1423.  
  1424.    Example: 
  1425.      C:> ASET -p X := INT(-4.9)
  1426.      X=-4
  1427.  
  1428.  
  1429. -------------------------------------------------------------------------------
  1430. ISDIR - Returns if the argument is an existing directory (result is 0 or 1)
  1431. -------------------------------------------------------------------------------
  1432.    Argument(s): 1, String 
  1433.    Result type: Boolean 
  1434.    Category   : Functions returning information about files and disks
  1435.  
  1436.    Example: 
  1437.      C:> ASET -p X := ISDIR('C:\BIN')
  1438.      X=1
  1439.  
  1440.  
  1441. -------------------------------------------------------------------------------
  1442. LABEL - Returns the label of a disk (default is disk in the current drive) (?
  1443.         on error)
  1444. -------------------------------------------------------------------------------
  1445.    Argument(s): from 0 to 1, String 
  1446.    Result type: String 
  1447.    Aliases    : VOLUME
  1448.    Category   : Functions returning information about files and disks
  1449.  
  1450.    Example: 
  1451.      C:> ASET -p X := LABEL('A:')
  1452.      X=DISK001
  1453.  
  1454.  
  1455. -------------------------------------------------------------------------------
  1456. LASTDRV - Returns the LASTDRIVE from CONFIG.SYS (E on error)
  1457. -------------------------------------------------------------------------------
  1458.    Argument(s): None
  1459.    Result type: String 
  1460.    Aliases    : LASTDRIVE
  1461.    Category   : Functions accessing CONFIG.SYS
  1462.  
  1463.    Example: 
  1464.      C:> ASET -p X := LASTDRV
  1465.      X=E
  1466.  
  1467.  
  1468. -------------------------------------------------------------------------------
  1469. LEAP - Determines whether a year is a leapyear (default is the current year)
  1470. -------------------------------------------------------------------------------
  1471.    Argument(s): from 0 to 1, Integer 
  1472.    Result type: Boolean 
  1473.    Aliases    : LEAPYEAR
  1474.    Category   : Time/date handling
  1475.  
  1476.    Example: 
  1477.      C:> ASET -p X := LEAP(1992)
  1478.      X=1
  1479.  
  1480.  
  1481. -------------------------------------------------------------------------------
  1482. LEFT - Extracts the leftmost part of a str (arguments are: string,length)
  1483. -------------------------------------------------------------------------------
  1484.    Argument(s): 2, String Integer 
  1485.    Result type: String 
  1486.    Aliases    : LEFTSTR
  1487.    See also   : RIGHT
  1488.    Category   : String handling
  1489.  
  1490.    Example: 
  1491.      C:> ASET -p X := LEFT('ABCDE',2)
  1492.      X=AB
  1493.  
  1494.  
  1495. -------------------------------------------------------------------------------
  1496. LEN - Returns the length of a string in characters
  1497. -------------------------------------------------------------------------------
  1498.    Argument(s): from 0 to 1, String 
  1499.    Result type: Integer 
  1500.    Aliases    : LENGTH
  1501.    Category   : String handling
  1502.  
  1503.    Example: 
  1504.      C:> ASET -p X := LEN('ABCD')
  1505.      X=4
  1506.  
  1507.  
  1508. -------------------------------------------------------------------------------
  1509. LINE - Returns the argument1-th line from the file with the name argument2
  1510.        (default line is 1, default file is standard input) (? on error)
  1511. -------------------------------------------------------------------------------
  1512.    Argument(s): from 0 to 2, Integer String 
  1513.    Result type: String 
  1514.    Aliases    : GETLINE
  1515.    Category   : User and file interaction functions
  1516.  
  1517.    Example: 
  1518.      C:> ASET -p X := LINE(1,'CONFIG.SYS')
  1519.      X=FILES=30
  1520.  
  1521.  
  1522. -------------------------------------------------------------------------------
  1523. LN - Computes the natural logarithm function
  1524. -------------------------------------------------------------------------------
  1525.    Argument(s): 1, Real 
  1526.    Result type: Real 
  1527.    See also   : EXP LOG
  1528.    Category   : Math functions
  1529.  
  1530.    Example: 
  1531.      C:> ASET -p X := LN(2.718282)
  1532.      X=1
  1533.  
  1534.  
  1535. -------------------------------------------------------------------------------
  1536. LOCASE - Converts a string to lowercase
  1537. -------------------------------------------------------------------------------
  1538.    Argument(s): from 0 to 1, String 
  1539.    Result type: String 
  1540.    Aliases    : LOWER
  1541.    See also   : UPCASE UPPER
  1542.    Category   : String handling
  1543.  
  1544.    Example: 
  1545.      C:> ASET -p X := LOCASE('AbCdE')
  1546.      X=abcde
  1547.  
  1548.  
  1549. -------------------------------------------------------------------------------
  1550. LOG - Computes the logarithm of the second argument to the base of the first
  1551.       argument
  1552. -------------------------------------------------------------------------------
  1553.    Argument(s): 2, Real Real 
  1554.    Result type: Real 
  1555.    See also   : LN
  1556.    Category   : Math functions
  1557.  
  1558.    Example: 
  1559.      C:> ASET -p X := LOG(10,100)
  1560.      X=2
  1561.  
  1562.  
  1563. -------------------------------------------------------------------------------
  1564. MAX - Returns the maximum entry from a numeric or string list
  1565. -------------------------------------------------------------------------------
  1566.    Argument(s): from 1 to 64, String 
  1567.    Result type: String 
  1568.    See also   : MIN
  1569.    Category   : Miscellanous functions
  1570.  
  1571.    Example: 
  1572.      C:> ASET -p X := MAX(1,'A',2)
  1573.      X=A
  1574.  
  1575.  
  1576. -------------------------------------------------------------------------------
  1577. MIN - Returns the minimum entry from a numeric or string list
  1578. -------------------------------------------------------------------------------
  1579.    Argument(s): from 1 to 64, String 
  1580.    Result type: String 
  1581.    See also   : MAX
  1582.    Category   : Miscellanous functions
  1583.  
  1584.    Example: 
  1585.      C:> ASET -p X := MIN(1,'A',2)
  1586.      X=1
  1587.  
  1588.  
  1589. -------------------------------------------------------------------------------
  1590. MINUTE - Returns the system minute
  1591. -------------------------------------------------------------------------------
  1592.    Argument(s): None
  1593.    Result type: Integer 
  1594.    See also   : HOUR SECOND
  1595.    Category   : Time/date handling
  1596.  
  1597.    Example: 
  1598.      C:> ASET -p X := MINUTE
  1599.      X=44
  1600.  
  1601.  
  1602. -------------------------------------------------------------------------------
  1603. MONTH - Returns the month in the year for a given date (default is today) (? on
  1604.         error)
  1605. -------------------------------------------------------------------------------
  1606.    Argument(s): from 0 to 1, String 
  1607.    Result type: String 
  1608.    Category   : Time/date handling
  1609.  
  1610.    Example: 
  1611.      C:> ASET -p X := MONTH('12/04/1992')
  1612.      X=12
  1613.  
  1614.  
  1615. -------------------------------------------------------------------------------
  1616. MONTHN - Returns the name of a month for a given date (default is today;
  1617.          argument1 is an optional language (one of American, German), default
  1618.          is American) (? on error)
  1619. -------------------------------------------------------------------------------
  1620.    Argument(s): from 0 to 2, String String 
  1621.    Result type: String 
  1622.    Aliases    : MONTHNAME
  1623.    Category   : Time/date handling
  1624.  
  1625.    Example: 
  1626.      C:> ASET -p X := MONTHN('12/04/1992')
  1627.      X=December
  1628.  
  1629.  
  1630. -------------------------------------------------------------------------------
  1631. NTH - Picks the n-th word of a string ('' on error)
  1632. -------------------------------------------------------------------------------
  1633.    Argument(s): 2, Integer String 
  1634.    Result type: String 
  1635.    Aliases    : PICK
  1636.    See also   : NTHARG PICKARG
  1637.    Category   : String handling
  1638.  
  1639.    Example: 
  1640.      C:> ASET -p X := NTH(2,'A B C')
  1641.      X=B
  1642.  
  1643.  
  1644. -------------------------------------------------------------------------------
  1645. NTHARG - Picks the n-th argument of a list ('' on error)
  1646. -------------------------------------------------------------------------------
  1647.    Argument(s): from 2 to 64, Integer String 
  1648.    Result type: String 
  1649.    Aliases    : PICKARG
  1650.    See also   : NTH PICK
  1651.    Category   : Miscellanous functions
  1652.  
  1653.    Example: 
  1654.      C:> ASET -p X := NTHARG(2,'A B','AB','ABC')
  1655.      X=AB
  1656.  
  1657.  
  1658. -------------------------------------------------------------------------------
  1659. ODD - Determines whether the argument is an odd integer number
  1660. -------------------------------------------------------------------------------
  1661.    Argument(s): 1, Integer 
  1662.    Result type: Boolean 
  1663.    See also   : EVEN
  1664.    Category   : Math functions
  1665.  
  1666.    Example: 
  1667.      C:> ASET -p X := ODD(2)
  1668.      X=0
  1669.  
  1670.  
  1671. -------------------------------------------------------------------------------
  1672. ORD - Returns the code of the first character in the argument (0, if the
  1673.       argument is '')
  1674. -------------------------------------------------------------------------------
  1675.    Argument(s): 1, String 
  1676.    Result type: Integer 
  1677.    Aliases    : ASC
  1678.    See also   : CHR CHAR
  1679.    Category   : String handling
  1680.  
  1681.    Example: 
  1682.      C:> ASET -p X := ORD(Auto)
  1683.      X=65
  1684.  
  1685.  
  1686. -------------------------------------------------------------------------------
  1687. PI - The constant pi
  1688. -------------------------------------------------------------------------------
  1689.    Argument(s): None
  1690.    Result type: Real 
  1691.    Category   : Math functions
  1692.  
  1693.    Example: 
  1694.      C:> ASET -p X := PI
  1695.      X=3.141593
  1696.  
  1697.  
  1698. -------------------------------------------------------------------------------
  1699. POS - Returns the position of a substring in a string (arguments are:
  1700.       pattern,string)
  1701. -------------------------------------------------------------------------------
  1702.    Argument(s): 2, String String 
  1703.    Result type: Integer 
  1704.    See also   : INSTR
  1705.    Category   : String handling
  1706.  
  1707.    Example: 
  1708.      C:> ASET -p X := POS('C','ABCDE')
  1709.      X=3
  1710.  
  1711.  
  1712. -------------------------------------------------------------------------------
  1713. QUOTE - Put a string in quotes (') (returns one single quote ('), if called
  1714.         without arguments)
  1715. -------------------------------------------------------------------------------
  1716.    Argument(s): from 0 to 1, String 
  1717.    Result type: String 
  1718.    See also   : UNQUOTE
  1719.    Category   : String handling
  1720.  
  1721.    Example: 
  1722.      C:> ASET -p X := QUOTE(a'b'c)
  1723.      X='a''b''c'
  1724.  
  1725.  
  1726. -------------------------------------------------------------------------------
  1727. RAMFREE - Determines the amount of free RAM memory
  1728. -------------------------------------------------------------------------------
  1729.    Argument(s): None
  1730.    Result type: Integer 
  1731.    Aliases    : MEMFREE
  1732.    Category   : Miscellanous functions
  1733.  
  1734.    Example: 
  1735.      C:> ASET -p X := RAMFREE
  1736.      X=300848
  1737.  
  1738.  
  1739. -------------------------------------------------------------------------------
  1740. RANDOM - Returns a random number
  1741. -------------------------------------------------------------------------------
  1742.    Argument(s): from 0 to 1, Integer 
  1743.    Result type: Real 
  1744.    Aliases    : RND
  1745.    Category   : Math functions
  1746.  
  1747.    Example: 
  1748.      C:> ASET -p X := RANDOM(100)
  1749.      X=67
  1750.  
  1751.  
  1752. -------------------------------------------------------------------------------
  1753. RIGHT - Returns the rightmost part of a string (arguments are: string,length)
  1754. -------------------------------------------------------------------------------
  1755.    Argument(s): 2, String Integer 
  1756.    Result type: String 
  1757.    Aliases    : RIGHTSTR
  1758.    See also   : LEFT
  1759.    Category   : String handling
  1760.  
  1761.    Example: 
  1762.      C:> ASET -p X := RIGHT('ABCDE',2)
  1763.      X=DE
  1764.  
  1765.  
  1766. -------------------------------------------------------------------------------
  1767. ROUND - Returns the value rounded to the next integer
  1768. -------------------------------------------------------------------------------
  1769.    Argument(s): 1, Real 
  1770.    Result type: Integer 
  1771.    See also   : INT TRUNC
  1772.    Category   : Math functions
  1773.  
  1774.    Example: 
  1775.      C:> ASET -p X := ROUND(-1.5)
  1776.      X=-2
  1777.  
  1778.  
  1779. -------------------------------------------------------------------------------
  1780. SECOND - Returns the system second
  1781. -------------------------------------------------------------------------------
  1782.    Argument(s): None
  1783.    Result type: Integer 
  1784.    See also   : HOUR MINUTE
  1785.    Category   : Time/date handling
  1786.  
  1787.    Example: 
  1788.      C:> ASET -p X := SECOND
  1789.      X=56
  1790.  
  1791.  
  1792. -------------------------------------------------------------------------------
  1793. SHELL - Returns the SHELL from CONFIG.SYS without additional parameters and
  1794.         switches (?:\COMMAND.COM on error)
  1795. -------------------------------------------------------------------------------
  1796.    Argument(s): None
  1797.    Result type: String 
  1798.    Category   : Functions accessing CONFIG.SYS
  1799.  
  1800.    Example: 
  1801.      C:> ASET -p X := SHELL
  1802.      X=C:\4DOS\4DOS.COM
  1803.  
  1804.  
  1805. -------------------------------------------------------------------------------
  1806. SIGN - Returns the sign of a number (-1, 0, or 1)
  1807. -------------------------------------------------------------------------------
  1808.    Argument(s): 1, Real 
  1809.    Result type: Integer 
  1810.    Aliases    : SGN
  1811.    Category   : Math functions
  1812.  
  1813.    Example: 
  1814.      C:> ASET -p X := SIGN(-1234.5)
  1815.      X=-1
  1816.  
  1817.  
  1818. -------------------------------------------------------------------------------
  1819. SIN - Computes the radiant sinus function
  1820. -------------------------------------------------------------------------------
  1821.    Argument(s): 1, Real 
  1822.    Result type: Real 
  1823.    See also   : SIND
  1824.    Category   : Math functions
  1825.  
  1826.    Example: 
  1827.      C:> ASET -p X := SIN(3.141593)
  1828.      X=0
  1829.  
  1830.  
  1831. -------------------------------------------------------------------------------
  1832. SIND - Computes the degree sinus function
  1833. -------------------------------------------------------------------------------
  1834.    Argument(s): 1, Real 
  1835.    Result type: Real 
  1836.    See also   : SIN
  1837.    Category   : Math functions
  1838.  
  1839.    Example: 
  1840.      C:> ASET -p X := SIND(90)
  1841.      X=1
  1842.  
  1843.  
  1844. -------------------------------------------------------------------------------
  1845. SINH - Computes the sinus hyperbolicus function
  1846. -------------------------------------------------------------------------------
  1847.    Argument(s): 1, Real 
  1848.    Result type: Real 
  1849.    Category   : Math functions
  1850.  
  1851.    Example: 
  1852.      C:> ASET -p X := SINH(1)
  1853.      X=1.175201
  1854.  
  1855.  
  1856. -------------------------------------------------------------------------------
  1857. SQR - Computes the square function (argument raised to the power of 2)
  1858. -------------------------------------------------------------------------------
  1859.    Argument(s): 1, Real 
  1860.    Result type: Real 
  1861.    Category   : Math functions
  1862.  
  1863.    Example: 
  1864.      C:> ASET -p X := SQR(2.5)
  1865.      X=6.25
  1866.  
  1867.  
  1868. -------------------------------------------------------------------------------
  1869. SQRT - Computes the square root function (argument raised to the power of 0.5)
  1870.        (? on error)
  1871. -------------------------------------------------------------------------------
  1872.    Argument(s): 1, Real 
  1873.    Result type: Real 
  1874.    Category   : Math functions
  1875.  
  1876.    Example: 
  1877.      C:> ASET -p X := SQRT(2)
  1878.      X=1.414214
  1879.  
  1880.  
  1881. -------------------------------------------------------------------------------
  1882. STACKX - Returns the number of stack frames from CONFIG.SYS (9 on error)
  1883. -------------------------------------------------------------------------------
  1884.    Argument(s): None
  1885.    Result type: Integer 
  1886.    Category   : Functions accessing CONFIG.SYS
  1887.  
  1888.    Example: 
  1889.      C:> ASET -p X := STACKX
  1890.      X=9
  1891.  
  1892.  
  1893. -------------------------------------------------------------------------------
  1894. STACKY - Returns the size of the stack frame from CONFIG.SYS (128 on error)
  1895. -------------------------------------------------------------------------------
  1896.    Argument(s): None
  1897.    Result type: Integer 
  1898.    Category   : Functions accessing CONFIG.SYS
  1899.  
  1900.    Example: 
  1901.      C:> ASET -p X := STACKY
  1902.      X=128
  1903.  
  1904.  
  1905. -------------------------------------------------------------------------------
  1906. SUBALL - Replaces all substrings in a string (arguments are: from,to,string)
  1907. -------------------------------------------------------------------------------
  1908.    Argument(s): 3, String String String 
  1909.    Result type: String 
  1910.    Aliases    : SUBSTALL
  1911.    See also   : SUBST
  1912.    Category   : String handling
  1913.  
  1914.    Example: 
  1915.      C:> ASET -p X := SUBALL('BC','_','ABC.BCD')
  1916.      X=A_._D
  1917.  
  1918.  
  1919. -------------------------------------------------------------------------------
  1920. SUBST - Replaces a substring once in a string (arguments are: from,to,string)
  1921. -------------------------------------------------------------------------------
  1922.    Argument(s): 3, String String String 
  1923.    Result type: String 
  1924.    Aliases    : SUBSTONE
  1925.    See also   : SUBALL
  1926.    Category   : String handling
  1927.  
  1928.    Example: 
  1929.      C:> ASET -p X := SUBST('BC','_','ABC.BCD')
  1930.      X=A_.BCD
  1931.  
  1932.  
  1933. -------------------------------------------------------------------------------
  1934. TAN - Computes the radiant tangens function
  1935. -------------------------------------------------------------------------------
  1936.    Argument(s): 1, Real 
  1937.    Result type: Real 
  1938.    See also   : TAND
  1939.    Category   : Math functions
  1940.  
  1941.    Example: 
  1942.      C:> ASET -p X := TAN(3.141593)
  1943.      X=0
  1944.  
  1945.  
  1946. -------------------------------------------------------------------------------
  1947. TAND - Computes the degree tangens function
  1948. -------------------------------------------------------------------------------
  1949.    Argument(s): 1, Real 
  1950.    Result type: Real 
  1951.    See also   : TAN
  1952.    Category   : Math functions
  1953.  
  1954.    Example: 
  1955.      C:> ASET -p X := TAND(45)
  1956.      X=1
  1957.  
  1958.  
  1959. -------------------------------------------------------------------------------
  1960. TANH - Computes the tangens hyperbolicus function
  1961. -------------------------------------------------------------------------------
  1962.    Argument(s): 1, Real 
  1963.    Result type: Real 
  1964.    Category   : Math functions
  1965.  
  1966.    Example: 
  1967.      C:> ASET -p X := TANH(1)
  1968.      X=0.761594
  1969.  
  1970.  
  1971. -------------------------------------------------------------------------------
  1972. TIME - Returns the current time  in the form HH:MM.SS
  1973. -------------------------------------------------------------------------------
  1974.    Argument(s): None
  1975.    Result type: String 
  1976.    Category   : Time/date handling
  1977.  
  1978.    Example: 
  1979.      C:> ASET -p X := TIME
  1980.      X=12:21.12
  1981.  
  1982.  
  1983. -------------------------------------------------------------------------------
  1984. TYPE - Returns the type of the argument (result is one of Boolean, Integer,
  1985.        Real, String, or Null)
  1986. -------------------------------------------------------------------------------
  1987.    Argument(s): from 0 to 1, String 
  1988.    Result type: String 
  1989.    Category   : Miscellanous functions
  1990.  
  1991.    Example: 
  1992.      C:> ASET -p X := TYPE(1)
  1993.      X=Boolean
  1994.  
  1995.  
  1996. -------------------------------------------------------------------------------
  1997. UNIQUE - Returns a unique (ie. non-existing) filename for a directory (default
  1998.          is the current directory)
  1999. -------------------------------------------------------------------------------
  2000.    Argument(s): from 0 to 1, String 
  2001.    Result type: String 
  2002.    Aliases    : TMPNAME
  2003.    Category   : Functions returning information about files and disks
  2004.  
  2005.    Example: 
  2006.      C:> ASET -p X := UNIQUE('C:\TMP')
  2007.      X=C:\TMP\14533457.TMP
  2008.  
  2009.  
  2010. -------------------------------------------------------------------------------
  2011. UNQUOTE - Remove one level of quotes (') from a string
  2012. -------------------------------------------------------------------------------
  2013.    Argument(s): from 0 to 1, String 
  2014.    Result type: String 
  2015.    See also   : QUOTE
  2016.    Category   : String handling
  2017.  
  2018.    Example: 
  2019.      C:> ASET -p X := UNQUOTE(QUOTE+'abc'+QUOTE)
  2020.      X=abc
  2021.  
  2022.  
  2023. -------------------------------------------------------------------------------
  2024. UPCASE - Converts a string to uppercase
  2025. -------------------------------------------------------------------------------
  2026.    Argument(s): from 0 to 1, String 
  2027.    Result type: String 
  2028.    Aliases    : UPPER
  2029.    See also   : LOCASE LOWER
  2030.    Category   : String handling
  2031.  
  2032.    Example: 
  2033.      C:> ASET -p X := UPCASE('AbCdE')
  2034.      X=ABCDE
  2035.  
  2036.  
  2037. -------------------------------------------------------------------------------
  2038. WDAY - Returns the day of a week for a given date (default is today),
  2039.        1=Sunday...7=Saturday (? on error)
  2040. -------------------------------------------------------------------------------
  2041.    Argument(s): from 0 to 1, String 
  2042.    Result type: Integer 
  2043.    See also   : WDAYN
  2044.    Category   : Time/date handling
  2045.  
  2046.    Example: 
  2047.      C:> ASET -p X := WDAY()
  2048.      X=6
  2049.  
  2050.  
  2051. -------------------------------------------------------------------------------
  2052. WDAYN - Returns the name of a weekday for a given date (default is today;
  2053.         argument1 is an optional language (one of American, German), default is
  2054.         American) (? on error)
  2055. -------------------------------------------------------------------------------
  2056.    Argument(s): from 0 to 2, String 
  2057.    Result type: String 
  2058.    Aliases    : WDAYNAME
  2059.    See also   : WDAY
  2060.    Category   : Time/date handling
  2061.  
  2062.    Example: 
  2063.      C:> ASET -p X := WDAYN('12/04/1992')
  2064.      X=Friday
  2065.  
  2066.  
  2067. -------------------------------------------------------------------------------
  2068. WORDS - Returns the number of words in the arguments (words are separated by
  2069.         SPACEs or TABs)
  2070. -------------------------------------------------------------------------------
  2071.    Argument(s): from 0 to 64, String 
  2072.    Result type: Integer 
  2073.    Aliases    : COUNT
  2074.    Category   : String handling
  2075.  
  2076.    Example: 
  2077.      C:> ASET -p X := WORDS('a b ','cde')
  2078.      X=3
  2079.  
  2080.  
  2081. -------------------------------------------------------------------------------
  2082. YEAR - Returns the year of a given date (default is today) (? on error)
  2083. -------------------------------------------------------------------------------
  2084.    Argument(s): from 0 to 1, String 
  2085.    Result type: Integer 
  2086.    Category   : Time/date handling
  2087.  
  2088.    Example: 
  2089.      C:> ASET -p X := YEAR('12/04/1992')
  2090.      X=1992
  2091.  
  2092.  
  2093.  
  2094.  
  2095. 9   Details
  2096. ===========
  2097.   This section will give you some details about the implementation of ASETs
  2098.   functions. If you have further questions, feel free to contact me.
  2099.  
  2100. 9.1   Evaluation errors
  2101. -----------------------
  2102.   Some functions are not defined for all possible values. Consider the
  2103.   function ARCCOS. It is defined only, if the argument is in the interval
  2104.   (-1.0,1.0). All those restricted functions will return '?' if you invoke
  2105.   them with an illegal argument. In detail these functions are (their aliases
  2106.   have the same restrictions, of course):
  2107.  
  2108.       Name            Restriction        Category
  2109.         ---------------------------------------------------------------
  2110.     ARCCOS(x)        -1 <= x <= 1        Math
  2111.         ARCCOSD(x)        -1 <= y <= 1
  2112.         ARCSIN(x)        -1 <= x <= 1
  2113.         ARCSIND(x)        -1 <= x <= 1
  2114.     LN(x)            x > 0
  2115.         LOG(x,y)        x,y > 0 and y <> 1
  2116.         SQRT(x)            x >= 0
  2117.         TAN(x)            x <> (2k+1)*pi/2
  2118.     TAND(x)            x <> (2k+1)*90
  2119.         DIR(drive)        Drive readable        Files and Disks
  2120.         DFREE(drive)        Drive readable
  2121.         DSIZE(drive)        Drive readable
  2122.         LABEL(drive)            Drive readable
  2123.     DOSPATH(fn)        File exists
  2124.         FATTR(fn)        File exists
  2125.         FDATE(fn)        File exists
  2126.         FSIZE(fn)        File exists
  2127.     FTIME(fn)        File exists
  2128.         FDIR(fn)        File exists
  2129.         FDRIVE(fn)        File exists
  2130.         FPATH(fn)        File exists
  2131.         FEXT(fn)        File exists
  2132.         FNAME(fn)        File exists
  2133.         FNAMEX(fn)        File exists
  2134.         UNIQUE(dir)        Dir exists
  2135.     CHR(n)            0 <= n <= 255        Strings
  2136.         COPY(s,m,n)             m>0, n>-1
  2137.         DELETE(s,m,n)           m>0, n>-1
  2138.         GETNUM(ml,df,r,c)       ml,r,c>0                Interaction
  2139.         GETSTR(ml,df,r,c)    ml,r,c>0
  2140.         GETLINE(n,fn)        File & line exists
  2141.         DAY(date)        Valid date        Date and time
  2142.         MONTH(date)        Valid date
  2143.         YEAR(date)        Valid date
  2144.         DOY(date)        Valid date
  2145.         WDAY(date)        Valid date
  2146.         MONTHN(date)        Valid date
  2147.         WDAYN(date)        Valid date
  2148.     BOOTDRV            DOS 4++            Miscellanous
  2149.  
  2150. 9.2   Internal data representation
  2151. ----------------------------------
  2152.   The following table shows which data types are internally used. This
  2153.   knowledge may be helpful in the case of the mathematic functions. Some of
  2154.   them are potential victims of arithmetic overflow. This is NOT CHECKED by
  2155.   ASET! The function FAC, eg., will only return correct results for arguments
  2156.   less than 13.
  2157.  
  2158.            Type     |          Range         |    Size   | Digits
  2159.           ----------+------------------------+-----------+--------
  2160.            String   |                        | 255 chars |
  2161.            Integer  |-2147483648..2147483647 |  32 bits  |
  2162.            Real     |    2.9e-39..1.7e38     |   6 bits  |   6
  2163.            Boolean  |    (integers 0 and 1)   |  32 bits  |
  2164.  
  2165.  
  2166. 9.3   Further notes
  2167. -------------------
  2168.   This section contains further information about certain functions or
  2169.   function groups.
  2170.  
  2171.  
  2172.   FAC
  2173.     works for negative values, also. FAC(n) is defined as n(n-1)(n-2)...1
  2174.     for positive, and n(n+1)(n+2)...-1 for negative integers. FAC(0) is 1,
  2175.     as usual.
  2176.  
  2177.  
  2178.   RANDOM
  2179.     If you invoke RANDOM without arguments, ie. something like
  2180.  
  2181.             ASET A=RANDOM
  2182.  
  2183.     it will return a real value in the interval [0.0,1.0]. If you invoke it
  2184.     with an integer number n as parameter, as in
  2185.  
  2186.             ASET A=RANDOM(1000)
  2187.  
  2188.     several cases are possible:
  2189.  
  2190.             n <= 0          RANDOM always returns zero
  2191.             0 < n < 65536   RANDOM returns a pseudo random number in the
  2192.                     integer interval [0,65534]
  2193.             n > 65535       RANDOM works as if RANDOM(65535) were invoked
  2194.  
  2195.  
  2196.   DIR,DFREE,DSIZE,LABEL
  2197.     do all accept a drive specification as their argument. They are implemented
  2198.     in a rather tolerant way. Each of them accepts not only arguments like
  2199.     'a', 'B', or 'C:', but also paths, like 'E:\FOO\SILLY.DAT'.
  2200.  
  2201.  
  2202.   UNIQUE
  2203.     generates a non-existing filename for a given directory. The name does
  2204.     have the format
  2205.  
  2206.             dddddddd.TMP
  2207.  
  2208.     where each d is a randomly chosen decimal digit. That means that
  2209.  
  2210.             61524212.TMP
  2211.  
  2212.     is one possible unique name. After one name is created, UNIQUE checks if
  2213.     it already exists (by trying to open it for reading). If it fails, the
  2214.     name is ok. Otherwise the procedure is repeated. If UNIQUE fails to
  2215.     generate a non-existing file name 10 times, it aborts and returns '?'.
  2216.  
  2217.  
  2218.   BUFFERS,COUNTRY,DEVICE,FCBX,FCBY,FILES,LASTDRIVE,SHELL,STACKY,STACKY
  2219.     read CONFIG.SYS, as you probably already know. The question is, how they
  2220.     find it. First they determine the boot drive by a DOS operation. This
  2221.     requires DOS 4.0 or above. If they fail to find CONFIG.SYS there (eg.
  2222.     because DOS 3.3 is used), they give 'C:\CONFIG.SYS' a try (because most
  2223.     systems boot from C:). If this also fails, they abort and return a
  2224.     default value, which is as follows (from my DOS 3.30 manual):
  2225.  
  2226.         BUFFERS        15 <if memory>521k, which is assumed>
  2227.         COUNTRY        001
  2228.         DEVICE        <returns 0 if failure or device not found>
  2229.     FCBX        4
  2230.     FCBY        0
  2231.     FILES        8
  2232.     LASTDRIVE    E
  2233.     SHELL        <see below>
  2234.     STACKY        9
  2235.     STACKY        128
  2236.  
  2237.  
  2238.   SHELL
  2239.     This function is treated separately to explain its algorithm. SHELL does
  2240.     first, as any other CONFIG.SYS function, try to locate a SHELL= line in
  2241.     CONFIG.SYS (see above for details). If it fails, it determines the boot
  2242.     drive (which needs DOS 4.0 or above). If it succeeds, 'd:\COMMAND.COM' is
  2243.     returned (with d being the boot drive), otherwise '?:\COMMAND.COM' is
  2244.     returned.
  2245.  
  2246.  
  2247.   CONCAT
  2248.     You might ask yourself, why this function is implemented where the '+'
  2249.     operator performs the same task. The answer is that '+' cannot be used
  2250.     to concat string which represent numbers. In this special case the
  2251.     arguments are interpreted as numbers and ADDED, not concatenated! CONCAT
  2252.     however does interpret its aruments never as numbers.
  2253.  
  2254.  
  2255.   GETKEY
  2256.     can also read function keys, because they are passed to ASET as _two_
  2257.     keystrokes, ascii 0 + ascii <code>. GETKEY simply ignores the 0, because
  2258.     it cannot belong to the key set, and interprets <code> as if it had been
  2259.     entered alone. This implies, that you can install GETKEY so that it can
  2260.     react on function keys, using the following replacements:
  2261.  
  2262.             Key      Char after #0        Code of char
  2263.                 --------------------------------------------
  2264.             F1        ;             59
  2265.                 F2        <             60    *
  2266.                 F3              =                    61
  2267.                 F4              >                    62 *
  2268.                 F5              ?                    63
  2269.                 F6              @                    64
  2270.                 F7              A                    65
  2271.                 F8              B                    66
  2272.                 F9              C                    67
  2273.                 F10             D                    68
  2274.                 LEFT        K             75
  2275.                 RIGHT           M                    77
  2276.                 UP              H                    72
  2277.                 DOWN            P                    80
  2278.                 PAGE UP         I                    73
  2279.                 PAGE DOWN       Q                    81
  2280.                 INS             R                    82
  2281.                 DEL             S                    83
  2282.                 POS 1           G                    71
  2283.                 END             O                    79
  2284.  
  2285.     There's a problem with the two codes marked with '*', because the chars
  2286.     '>' and '<' are interpreted by DOS. You will be able to use these only
  2287.     if your shell has a possibility to pass them to programs.
  2288.  
  2289.     Example:     The following call
  2290.  
  2291.                 ASET A = GETKEY('KMHPIQ')
  2292.  
  2293.             does not only accept they keys K,M,H,P,I, and Q themselves,
  2294.         but also the cursor keys and PageUp and PageDown.
  2295.  
  2296.  
  2297.   GETSTRING,GETNUMBER
  2298.     These functions understand the following control keys:
  2299.         Cursor Left        Back one character
  2300.         Cursor Right        Forward one character
  2301.         Delete            Delete character under the cursor
  2302.         End            Goto the last character
  2303.         Pos 1            Goto the first character
  2304.         Ins            Toggle insert (default) and overwrite mode
  2305.         Return            Terminate input
  2306.         Ctrl/H (Backspace)    Delete character before the cursor
  2307.         Ctrl/Y            Delete the whole string and start again
  2308.  
  2309.  
  2310.   LINE
  2311.     This function returns a line from standard input or a certain file. It
  2312.     returns '?' if the line does not exist in the file.
  2313.  
  2314.  
  2315.   DAY,MONTH,YEAR,DOY,WDAY,WDAYN,MONTHN
  2316.     do all accept a date as argument. Currently, there are these valid formats
  2317.     for dates:
  2318.  
  2319.             Format        Example
  2320.                 -------------------------
  2321.         dd.mm.yyyy      4.12.1963
  2322.         mm-dd-yyyy      12-4-1963
  2323.         mm/dd/yyyy    12/4/1963
  2324.  
  2325.  
  2326.   BOOTDRIVE
  2327.     needs DOS 4.0 or above to operate.
  2328.  
  2329.  
  2330.   ENVCOUNT,ENVUSED
  2331.     compute their results without accounting for the environment modification
  2332.     caused by the very call of ASET.
  2333.  
  2334.  
  2335.   MAX,MIN
  2336.     These functions use the following algorithm. In a first run they try to
  2337.     consider all arguments as numbers and compute their maximum/minimum. If
  2338.     they encounter the first non-number, they switch to string mode and
  2339.     rescan the arguments, looking at them as strings.
  2340.  
  2341.  
  2342.   RAMFREE
  2343.     A call to this function returns the current amount of free memory. The
  2344.     value has been affected by ASET before it was computed and might be
  2345.     affected even after the computation (if ASET has some more functions to
  2346.     evaluate). It is therefore to be taken as a circa value.
  2347.  
  2348.  
  2349.   IF,AIF
  2350.     The functions IF and AIF can be a powerful help if (but not only if) you
  2351.     use ASET in file mode, ie., if you invoke ASET with the /f option to read
  2352.     a file containing several assignments. IF and AIF can be used in most
  2353.     cases where the DOS IF statement could have been used (which is not
  2354.     possible in ASET files).
  2355.  
  2356.