home *** CD-ROM | disk | FTP | other *** search
/ ProfitPress Mega CDROM2 …eeware (MSDOS)(1992)(Eng) / ProfitPress-MegaCDROM2.B6I / UTILITY / SYSTEM / XSET11.ZIP / XSET.DOC < prev    next >
Encoding:
Text File  |  1991-02-02  |  6.4 KB  |  222 lines

  1.     ┌──────────────────────────────────────────────────────────┐
  2.     │    ENHANCED  SET  INSTRUCTION  -  (C) 1991 STERN Marc    │
  3.     └──────────────────────────────────────────────────────────┘
  4.  
  5.  
  6.     All you always wanted to put in an environment variable and
  7.  never dare to ask DOS for...
  8.  
  9.  
  10.     XSET allows you to put EVERYTHING you want in a variable of
  11.  the current environment and use it as if you gave it the value with
  12.  the standard DOS command 'SET'. You will be able to write very efficient
  13.  batch files including string manipulation, calculation,...
  14.  
  15.     XSET is the more powerful environment variable manipulation
  16.  program you never saw. It also has the easiest and most intuitive
  17.  user interface it is possible to write.
  18.  
  19.      XSET is fully compatible DOS 5.0 .
  20.  
  21.  
  22.  
  23.  XSET has four major features:
  24.  ════════════════════════════
  25.  
  26.   - XSET permits to catch the output of any command (internal or external)
  27.     or program and put it into an environment variable.
  28.  
  29.   - XSET has several built-in commands to modify the output of a program
  30.     or a string given on the command-line (extract a part of a string,...)
  31.                                                                           
  32.   - XSET has a built-in full floating-point calculation functionalitie:
  33.                         ──────────────────────────────────────────────
  34.     You can make incremental loops, input a calculation string and
  35.     output a number,...
  36.  
  37.   - XSET has some other built-in commands to give you access to some
  38.     system datas (date, time, ...)
  39.  
  40.  
  41.  
  42.   * type XSET with no parameters to have the full description
  43.     of all functionalities (parameters and effects).
  44.  
  45.  
  46.  
  47.  Example of use:
  48.  ══════════════
  49.  
  50.   Rem: in all the examples, the command XSET and the its built-in commands
  51.        are typed in uppercase and the environment variables names are
  52.        in lowercase. This is only for readability; when you type it,
  53.        you may mix lowercases and uppercase as you want.
  54.        The case is only significant for arguments strings you enter on the
  55.        command-line.
  56.        The 'C:>' represents your prompt, do not type it!
  57.  
  58.  
  59.   1)      C:> XSET datvar DATE
  60.   Puts the date into the variable 'datvar'
  61.  
  62.   Type the command SET and you will see all the environment variables:
  63.           ...
  64.           COMSPEC=...
  65.           DATVAR=dd-mm-yy    (where dd,mm,yy are replaced by current
  66.                            day, month and year)
  67.           ...
  68.  
  69.   You can now use the variable 'datvar' in a batch file:
  70.           ECHO the date is %datvar%
  71.  
  72.   2)      C:> XSET name INPUT "Enter your name: "
  73.   Inputs a string from the keyboard (usual answer terminated by <Enter>)
  74.   and puts it into the variable 'name'.
  75.  
  76.   You can now use the variable 'name' in a batch file to enter
  77.   personal environment for each user:
  78.           ECHO Hello %name%, beginning the work
  79.           CD \%name%
  80.  
  81.     
  82.   3)      C:> CD | XSET dirname
  83.   Puts the output of the command 'CD' (i.e. the current directory name)
  84.   into the variable 'dirname'.
  85.  
  86.   You can write a batch file to go to another directory, execute
  87.   a program and come back into the current one
  88.  
  89.     rem ------------------
  90.  
  91.     CD | XSET dirname
  92.     CD \otherdir
  93.     myprog ...
  94.        cd %dirname%
  95.        set dirname=
  96.  
  97.        rem ------------------
  98.  
  99.  
  100.  
  101.   4)  You can write a batch file with automatic loops
  102.  
  103.  
  104.       rem ------------------
  105.  
  106.       set loop=1
  107.  
  108.         :next                         
  109.               if %loop% == 20 goto end
  110.  
  111.               .......
  112.               anything you want
  113.               .......
  114.  
  115.               XSET loop MATH %loop% + 1
  116.  
  117.               goto next
  118.               
  119.         :end
  120.  
  121.        rem ------------------
  122.  
  123.  
  124.   5)  You can write a batch file where the user may enter
  125.       a calculation and use it as a number
  126.  
  127.  
  128.       rem ------------------
  129.                                           
  130.       XSET calc INPUT "Enter your calculation: "
  131.  
  132.         XSET result MATH %calc%
  133.  
  134.         echo %calc% = %result%
  135.  
  136.        rem ------------------
  137.  
  138.  
  139.  
  140.  
  141.   6)  More complex example of a login procedure
  142.  
  143.           rem ---------------------- LOGIN.BAT --------------------------------
  144.  
  145.           echo off
  146.           cls
  147.  
  148.           rem    Ask login name from keyboard
  149.           rem    ----------------------------
  150.           XSET login INPUT "Enter login name : "
  151.  
  152.           rem    Test if directory corresponding to login name already exist
  153.           rem    -----------------------------------------------------------
  154.           if exist c:\%login%\nul goto LOGIN
  155.  
  156.           rem    Directory does not exist, ask to create it
  157.           rem    ------------------------------------------
  158.           echo:
  159.           echo Login '%login%' does not exist.
  160.           echo Do you want to create it? (Y/N)
  161.  
  162.           rem    Only "yYnN" keys are allowed
  163.           rem    ----------------------------
  164.           XSET ask KEY "yYnN"
  165.           XSET ask UPPER %ask%
  166.           if "%ask%" == "N" goto INPUT
  167.  
  168.           rem    Create directory
  169.           rem    ----------------
  170.           md c:\%login%
  171.  
  172.           :LOGIN
  173.           set ask=
  174.  
  175.           cd \%login%
  176.           if exist autouser.bat autouser.bat
  177.  
  178.           rem -----------------------------------------------------------------
  179.  
  180.   7)  And much more ...
  181.  
  182.  
  183.   Installation:
  184.   ════════════
  185.  
  186.      - XSET.EXE is ready to use; no installation,
  187.        but it is a SHAREWARE version.
  188.  
  189.      - To get a registered version of XSET, print the XSET.REG file,
  190.        fill it and send it to me; you will then receive the password
  191.        mandatory to use the program REGISTER.
  192.        
  193.      - if a registered people gave you the program (the shareware version 
  194.        obviously), put his name to the registration formular; he will
  195.        so receive each new upgrade for free!!!
  196.  
  197.  
  198.   Problems:
  199.   ════════
  200.   
  201.      - If the size of your environment space is not big enough,
  202.        you will receive an error message
  203.  
  204.              'XSET : not enough environment space.'
  205.              
  206.        This is not a bug, it is because the environment space
  207.        reserved for the variables is too small. 
  208.        You must increase it by modifying the line 'SHELL=...'
  209.        in your CONFIG.SYS. By default, DOS reserves 256 bytes
  210.        environment space; this is generally insufficient.
  211.        Try 640 bytes (or more if you need it) by adding '/e:640'
  212.        at the line 'SHELL=...'                           
  213.        
  214.        ex:    SHELL=COMMAND.COM /E:640 /P
  215.  
  216.  
  217.  
  218.   Additional information:     32.2.427.98.52 (after 19h)
  219.   ══════════════════════   or 32.2.465.01.19
  220.  
  221.                   E-mail:     stern@mble.philips.be
  222.