home *** CD-ROM | disk | FTP | other *** search
- ┌──────────────────────────────────────────────────────────┐
- │ ENHANCED SET INSTRUCTION - (C) 1991 STERN Marc │
- └──────────────────────────────────────────────────────────┘
-
-
- All you always wanted to put in an environment variable and
- never dare to ask DOS for...
-
-
- XSET allows you to put EVERYTHING you want in a variable of
- the current environment and use it as if you gave it the value with
- the standard DOS command 'SET'. You will be able to write very efficient
- batch files including string manipulation, calculation,...
-
- XSET is the more powerful environment variable manipulation
- program you never saw. It also has the easiest and most intuitive
- user interface it is possible to write.
-
- XSET is fully compatible DOS 5.0 .
-
-
-
- XSET has four major features:
- ════════════════════════════
-
- - XSET permits to catch the output of any command (internal or external)
- or program and put it into an environment variable.
-
- - XSET has several built-in commands to modify the output of a program
- or a string given on the command-line (extract a part of a string,...)
-
- - XSET has a built-in full floating-point calculation functionalitie:
- ──────────────────────────────────────────────
- You can make incremental loops, input a calculation string and
- output a number,...
-
- - XSET has some other built-in commands to give you access to some
- system datas (date, time, ...)
-
-
-
- * type XSET with no parameters to have the full description
- of all functionalities (parameters and effects).
-
-
-
- Example of use:
- ══════════════
-
- Rem: in all the examples, the command XSET and the its built-in commands
- are typed in uppercase and the environment variables names are
- in lowercase. This is only for readability; when you type it,
- you may mix lowercases and uppercase as you want.
- The case is only significant for arguments strings you enter on the
- command-line.
- The 'C:>' represents your prompt, do not type it!
-
-
- 1) C:> XSET datvar DATE
- Puts the date into the variable 'datvar'
-
- Type the command SET and you will see all the environment variables:
- ...
- COMSPEC=...
- DATVAR=dd-mm-yy (where dd,mm,yy are replaced by current
- day, month and year)
- ...
-
- You can now use the variable 'datvar' in a batch file:
- ECHO the date is %datvar%
-
- 2) C:> XSET name INPUT "Enter your name: "
- Inputs a string from the keyboard (usual answer terminated by <Enter>)
- and puts it into the variable 'name'.
-
- You can now use the variable 'name' in a batch file to enter
- personal environment for each user:
- ECHO Hello %name%, beginning the work
- CD \%name%
-
-
- 3) C:> CD | XSET dirname
- Puts the output of the command 'CD' (i.e. the current directory name)
- into the variable 'dirname'.
-
- You can write a batch file to go to another directory, execute
- a program and come back into the current one
-
- rem ------------------
-
- CD | XSET dirname
- CD \otherdir
- myprog ...
- cd %dirname%
- set dirname=
-
- rem ------------------
-
-
-
- 4) You can write a batch file with automatic loops
-
-
- rem ------------------
-
- set loop=1
-
- :next
- if %loop% == 20 goto end
-
- .......
- anything you want
- .......
-
- XSET loop MATH %loop% + 1
-
- goto next
-
- :end
-
- rem ------------------
-
-
- 5) You can write a batch file where the user may enter
- a calculation and use it as a number
-
-
- rem ------------------
-
- XSET calc INPUT "Enter your calculation: "
-
- XSET result MATH %calc%
-
- echo %calc% = %result%
-
- rem ------------------
-
-
-
-
- 6) More complex example of a login procedure
-
- rem ---------------------- LOGIN.BAT --------------------------------
-
- echo off
- cls
-
- rem Ask login name from keyboard
- rem ----------------------------
- XSET login INPUT "Enter login name : "
-
- rem Test if directory corresponding to login name already exist
- rem -----------------------------------------------------------
- if exist c:\%login%\nul goto LOGIN
-
- rem Directory does not exist, ask to create it
- rem ------------------------------------------
- echo:
- echo Login '%login%' does not exist.
- echo Do you want to create it? (Y/N)
-
- rem Only "yYnN" keys are allowed
- rem ----------------------------
- XSET ask KEY "yYnN"
- XSET ask UPPER %ask%
- if "%ask%" == "N" goto INPUT
-
- rem Create directory
- rem ----------------
- md c:\%login%
-
- :LOGIN
- set ask=
-
- cd \%login%
- if exist autouser.bat autouser.bat
-
- rem -----------------------------------------------------------------
-
- 7) And much more ...
-
-
- Installation:
- ════════════
-
- - XSET.EXE is ready to use; no installation,
- but it is a SHAREWARE version.
-
- - To get a registered version of XSET, print the XSET.REG file,
- fill it and send it to me; you will then receive the password
- mandatory to use the program REGISTER.
-
- - if a registered people gave you the program (the shareware version
- obviously), put his name to the registration formular; he will
- so receive each new upgrade for free!!!
-
-
- Problems:
- ════════
-
- - If the size of your environment space is not big enough,
- you will receive an error message
-
- 'XSET : not enough environment space.'
-
- This is not a bug, it is because the environment space
- reserved for the variables is too small.
- You must increase it by modifying the line 'SHELL=...'
- in your CONFIG.SYS. By default, DOS reserves 256 bytes
- environment space; this is generally insufficient.
- Try 640 bytes (or more if you need it) by adding '/e:640'
- at the line 'SHELL=...'
-
- ex: SHELL=COMMAND.COM /E:640 /P
-
-
-
- Additional information: 32.2.427.98.52 (after 19h)
- ══════════════════════ or 32.2.465.01.19
-
- E-mail: stern@mble.philips.be
-