XSet -- Extended SET Utility V5.7 (c) pAkUiT 1993-2014 J.H.Hamakers Normal operation: ================ XSet = Parameters (re)defines an environment variable Debugging: ========= XSet == Parameters (re)defines an environment variable and echos result XSet =: Parameters Just echos the result Win NT/2000/XP etc: ================== In Win NT/2000/XP etc. it is not possible to set variables from a program. (if anyone can tell me how to modify the DOS env segment memory don't hesitate to tell me how) Workaround is to use a generated Batchfile: XSet =@ Parameters (re)defines an environment variable via XSETX.BAT Run XSETX.BAT yourself. e.g. XSET AA=@Month Call XSETX The file is created in the current dirtectory. With the aid of the environmentvariable 'XSET' a path can be defined: e.g. Set XSET=C:\TEMP XSET AA=@Month Call C:\TEMP\XSETX or Call %XSET%\XSETX XSet =# Parameters The same as =@ ,only the line is appended to an existing XSETX.BAT file. e.g. XSET AA=@Month XSET BB=#Year Call XSETX Win XP/VISTA 64-bit systems and Win 7/8: ======================================= These are NOT supported due to the fact that the DOS boxes they have are NOT compatible. A freeware program called DOSBOX can be used. XSET versions V5.3 and higher are corrected for this. Parameters: ========== If proceded by an '@' the value is taken as the name of an environmentvariable e.g. XSET VAR1=Month ; VAR1 := a value between 1 and 12 ; representingthe current month. XSET VAR1=Mul @VAR1 10 ; VAR1 := the former value x 10. ----------------------------------------------------------------------------- Operator Description Example Result ----------------------------------------------------------------------------- -arithmetic------------------------------------------------------------------ ----------------------------------------------------------------------------- + Integer Add + 2 3 5 (2+3) ADD Integer Add Add 2 3 4 9 (2+3+4) - Integer Subtract - 4 3 1 (4-3) SUB Integer Subtract Sub 4 3 2 -1 (4-3-2) * Integer Multiply * 2 3 4 24 (2*3*4) MUL Integer Multiply Mul 2 3 4 24 (2*3*4) / Integer Divide / 30 3 10 (30/3) DIV Integer Divide Div 30 3 2 5 ((30/3)/2) ABS Absolute Integer ABS -23 23 DEC Decrement Integer Dec 20 19 (20-1) INC Increment Integer Inc 20 21 (20+1) ----------------------------------------------------------------------------- -logic----------------------------------------------------------------------- ----------------------------------------------------------------------------- = Integer compare = 23 24 0 EQ Integer compare Eq 23 23 1 GE Integer => Ge 23 24 0 GT Integer > Gt 24 23 1 LE Integer <= Le 23 24 1 LT Integer < Lt 24 23 0 OR Logical Or Or 1 3 4 7 (1|2|3) XOR Logical Xor Xor 3 5 8 14 (3#5#8) AND Logical And And 1 7 3 1 (1and7and3) ODD Odd test Odd 7 1 EVEN Even test Even 7 0 ----------------------------------------------------------------------------- -system---------------------------------------------------------------------- ----------------------------------------------------------------------------- Various data concerning CPU: CPUBrand 0 CPUExModel Extended model from signature 0 CPUFamily Family from signature 6 CPUModel Model from signature 7 CPUType Type from signature 0 CPUSignature Translated signature --> Pent. III, Pent. III Xeon, (mod7) CPUSignatureNum Signature numeric 0067h CPUStepping Stepping from signature 10 CPUVendor Vendor string GenuineIntel CPUBrandstring Brand string --> Intel(R) Core(TM)2 Duo CPU P8600 @ 2.40GHz CPUV86 V86 mode (on|off = 1|0) 1 CPU CPU Family Pentium (P6) --> CPU's > unknown, 8086/8088, 80286, 80386, 80486, Pentium, Pentium (P6), Pentium 4 FPU Coprocessor type 80387 NPU Coprocessor type Included --> NPUs > No, 8087, 80287, 80387, Included (in CPU) BREAK Dos Breakflag Break 1 DOSERROR Dos error DosError 0 DOSEXITCODE Dos exit code DosExitCode 0 DOSVER Dos version DosVer 6.2 Windows 2000 and Higher always report 5.0 INWIN True if in windows InWin 1 LASTDRIVE Dos Lastdrive Lastdrive F: BOOTDISK Boot Disk BootDisk C: BOOTDRIVE Boot Disk BootDrive C: Result of BootDisk and BootDrive is always correct if DOS version > 3.x With DOS Version < 4.0 result is derived from the COMSPEC variable. With DOS under Windows NT and higher result is derived from the SystemDrive variable. CURDRIVE Current drive CurDrive C: CURDIR Current path CurDir C:\DOS DIR Drive directory Dir C: C:\Dos DIRBSLASH Directory + Bslash DirBSlash C:\Dos C:\Dos\ DIRNOBSLASH Directory - Bslash DirNoBSlash C:\Dos\ C:\Dos DOSPATH Full Path DosPath Bla.Exe C:\DOS\BLA.EXE WINDRIVE Windows drive WinDrive C: WINDIR Windows path WinDir \WINDOWS\ ----------------------------------------------------------------------------- -string---------------------------------------------------------------------- ----------------------------------------------------------------------------- CHAR Integer > Character CHAR 43 + ORD Character > Integer ORD + 43 HEX Integer > Hexstring HEX 12345 0x3039 DIGITS Add leading zero's DIGITS 12 4 0012 DIGITS 123 4 0123 ----------------------------------------------------------------------------- COPY Substring Copy Jones 2 3 one Copy "Tom Jones" 3 6 m Jone Copy ~Tom Jones~ 3 6 m Jone Copy 'Tom Jones' 3 6 m Jone ----------------------------------------------------------------------------- DELETE Delete substring Delete Jones 2 3 Js Delete "Tom Jones" 3 4 Tones Delete ~Tom Jones~ 3 4 Tones Delete 'Tom Jones' 3 4 Tones ----------------------------------------------------------------------------- INSERT Insert substring Insert XYZ Jones 4 JonXYZes Insert "X Y" Jones 4 JonX Yes Insert mie "Tom Jones" 4 Tommie Jones Insert " J." "Tom Jones" 4 Tom J. Jones Insert ~ J.~ ~Tom Jones~ 4 Tom J. Jones Insert ' J.' 'Tom Jones' 4 Tom J. Jones ----------------------------------------------------------------------------- APPEND Append substring Append XYZ Jones JonesXYZ Append ", Tom" Jones Jones, Tom Append son "Tom Jones" Tom Jonesson Append " Jr." "Tom Jones" Tom Jones Jr. Append ~ Jr.~ ~Tom Jones~ Tom Jones Jr. Append ' Jr.' 'Tom Jones' Tom Jones Jr. ----------------------------------------------------------------------------- CONCAT Concatenate strings Concat XYZ Jones XYZJones Concat "T.W. " Jones T.W. Jones Concat "Tom " "W. Jones" Tom W. Jones Concat "Mr. " "Tom Jones" Mr. Tom Jones Concat ~Mr. ~ ~Tom Jones~ Mr. Tom Jones Concat 'Mr. ' 'Tom Jones' Mr. Tom Jones ----------------------------------------------------------------------------- LENGTH String length Length thirteen 8 Length "thirteen and one" 16 Length ~thirteen and one~ 16 Length 'thirteen and one' 16 ----------------------------------------------------------------------------- POS Substring position Pos ne Jones 3 Pos "m J" "Tom Jones" 3 Pos ~m J" "Tom Jones~ 3 Pos 'm J" "Tom Jones' 3 ----------------------------------------------------------------------------- LOWCASE LowCase string LowCase Jones jones LowCase "Tom Jones" tom jones LowCase ~Tom Jones~ tom jones LowCase 'Tom Jones' tom jones ----------------------------------------------------------------------------- UPCASE UpCase string UpCase Jones JONES UpCase "Tom Jones" TOM JONES UpCase ~Tom Jones~ TOM JONES UpCase 'Tom Jones' TOM JONES ----------------------------------------------------------------------------- TRIM Trim string Trim " Tom Jones " Tom Jones Trim ~ Tom Jones ~ Tom Jones Trim ' Tom Jones ' Tom Jones ----------------------------------------------------------------------------- # Parameter count # foo foo2 foo3 3 COUNT Parameter count Count one two three 3 ----------------------------------------------------------------------------- REVSTR Reverse string RevStr Jones senoJ RevStr "Tom Jones" senoJ moT RevStr ~Tom Jones~ senoJ moT RevStr 'Tom Jones' senoJ moT ----------------------------------------------------------------------------- -date & time----------------------------------------------------------------- ----------------------------------------------------------------------------- DATE Current date Date 30-05-1993 DAY Current day Day 30 MONTH Month Month 5 MAANDNAAM Dutch month name MaandNaam Mei MONTHNAME Month name MonthName May YEAR Year 4 digits Year 1993 YEARSHORT Year 2 digits YearShort 93 WDAY Day of the week (1..7, 1 = monday) WDay 2 WDAGNAAM Dutch Weekday name WDagNaam Dinsdag WDAYNAME Weekday name WDayName Tuesday WEEK Weeknumber 2 digits Week 13 ----------------------------------------------------------------------------- TIME Current Time Time 22:40:24 HOUR Hour of the day Hour 22 MINUTE Minute Minute 40 SECONDS Seconds Seconds 24 ----------------------------------------------------------------------------- -disks----------------------------------------------------------------------- ----------------------------------------------------------------------------- DISKFREE Free disk space DiskFree C: 16939008 DISKFREEK Free disk space Kb DiskFreeK C: 16542 DISKFREEM Free disk space Mb DiskFreeM C: 16 DISKSIZE Disk size DiskSize C: 33419264 DISKSIZEK Disk size Kb DiskSizeK C: 32636 DISKSIZEM Disk size Mb DiskSizeM C: 31 All Return a value of -1 when drive does not exist LABEL Disk label Label C: SYSTEM ----------------------------------------------------------------------------- -environment----------------------------------------------------------------- ----------------------------------------------------------------------------- ENVCOUNT # of env. strings EnvCount 12 ENVFREE Bytes free in Env. EnvFree 700 ENVSIZE Size of Environment EnvSize 1024 ENVUSED Bytes used in Env. EnvUsed 324 ENVSEGM Env memory segment EnvSegm 0x04DB ------------------------------------------------------------------------------ -files----------------------------------------------------------------------- ----------------------------------------------------------------------------- FATTR File attributes FAttr C:\IO.SYS RHSA FILEATTR File attributes FileAttr C:\XSET.EXE ---A FDATE File creation date FDate C:\XSET.EXE 14-12-1993 FILEDATE File creation date FileDate C:\XSET.FOO 00-00-0000 Assumed is that XSET.FOO does not exists FSIZE File size FSize C:\XSET.EXE 40860 FILESIZE File size FileSize C:\XSET.FOO -1 Assumed is that XSET.FOO does not exists FTIME File creation time FTime C:\XSET.EXE 23:20:34 FILETIME File creation time FileTime C:\XSET.FOO 00:00:00 Assumed is that XSET.FOO does not exists ----------------------------------------------------------------------------- -parsing--------------------------------------------------------------------- ----------------------------------------------------------------------------- These functions also support filenames > 8 and Extensions > 3 FDRIVE Drive FDrive C:\AA\BB\CC.EEE C: FILEDRIVE Drive FileDrive C:\AA\BB\CC.EEE C: FDIR Directory FDir C:\AA\BB\CC.EEE \AA\BB\ FILEDIR Directory FileDir C:\AA\BB\CC.EEE \AA\BB\ FPATH Path FPath C:\AA\BB\CC.EEE C:\AA\BB\ FILEPATH Path FilePath C:\AA\BB\CC.EEE C:\AA\BB\ FNAME File name FName C:\AA\BB\CC.EEE CC FILENAME File name FileName C:\AA\BB\CC.EEE CC FEXT Extension FExt C:\AA\BB\CC.EEE .EEE FILEEXT Extension FileExt C:\AA\BB\CC.EEE .EEE FNAMEX File name + ext FNameX C:\AA\BB\CC.EEE CC.EEE FILENAMEX File name + ext FileNameX C:\AA\BB\CC.EEE CC.EEE ----------------------------------------------------------------------------- -various--------------------------------------------------------------------- ----------------------------------------------------------------------------- COPYRIGHT Copyright statement Copyright (c) pAkUiT 1993-2013 J.H.Hamakers GREETING Gr. depend on time Greeting Good morning GROET Dutch Greeting Groet Goedemorgen VER XSET Version Ver 5.7 VERNR XSET Version (num) Vernr 57 VERSION XSET Version (ext) Version XSet -- Extended SET Utility V5.7 ----------------------------------------------------------------------------- -dagber-functions------------------------------------------------------------ ----------------------------------------------------------------------------- DAGBER (DAY CALculation in English) These functions make use of the DAGBER routine Range: 1953 ... 2052 DagBer(Day,Month,Year,YrFull,DaYNr,WeekNr,DaySeq,DayAbs,DayCnt,Moonph,Error) Input/output variables: ======================= Day : 1 ... 31 If not specified (-1) "today" is taken Month : 1 ... 12 If not specified (-1) "today" is taken Year : 0 ... 99 If not specified (-1) "today" is taken DayCnt : 1 ... x Daycount 01-01-1953 = 1 If not specified (-1) DAY, MONTH and YEAR is taken Output variables: ================= JrFull : Full year (82 = 1982, 10 = 2010) DagNr : Daynumber ( 1 ... 7 , 1 = monday) WeekNr : Weeknumber ( 1 ... 53 ) DagSeq : Daynumber in the year. January 1st = 1 DagAbs : Dagnummer (((Weeknr-1) * 7) + daynr) MoonPh : Phase of the moon (0 ... 15) 0 = New moon 4 = First quarter 8 = Full moon 12 = Last quarter ----------------------------------------------------------------------------- DAGBER Returns DAGBER string day-month-year-yrfull-daynr-weeknr-dayseq-dayabs-daycnt-moonph takes as input day month year daycnt e.g. DAGBER result 07-07-02-2002-1-27-182-183-18079-12 DAGBER 16 10 86 result 16-10-86-1986-4-42-289-291-12342-8 DAGBER -1 -1 -1 12342 result 16-10-86-1986-4-42-289-291-12342-8 ----------------------------------------------------------------------------- DBDAY, DBDAG Returns DAGBER "day of the month" in 2 digits takes as input day month year daycnt e.g. DBDAG result 16 DBDAY 16 10 86 result 16 DBDAY -1 -1 -1 12342 result 16 ----------------------------------------------------------------------------- DBMONTH, DBMAAND Returns DAGBER "month" in 2 digits takes as input day month year daycnt e.g. DBMONTH result 10 DBMAAND 16 10 86 result 10 DBMONTH -1 -1 -1 12342 result 10 ----------------------------------------------------------------------------- DBYEAR, DBJAAR Returns DAGBER "year" in 2 digits takes as input day month year daycnt e.g. DBYEAR result 86 DBJAAR 16 10 86 result 86 DBYEAR -1 -1 -1 12342 result 86 ------------------------------------------------------------------------------ DBYRFULL, DBJRFULL Returns DAGBER "year" in 4 digits takes as input day month year daycnt e.g. DBYRFULL result 1986 DBJRFULL 16 10 86 result 1986 DBYRFULL -1 -1 -1 12342 result 1986 ----------------------------------------------------------------------------- DBDAYNR, DBDAGNR Returns DAGBER "daynr" takes as input day month year daycnt e.g. DBDAYNR result 1 DBDAGNR 16 10 86 result 4 DBDAYNR -1 -1 -1 12342 result 4 ----------------------------------------------------------------------------- DBWEEKNR Returns DAGBER weeknr takes as input day month year daycnt e.g. DBWEEKNR result 27 DBWEEKNR 16 10 86 result 42 DBWEEKNR -1 -1 -1 12342 result 42 ----------------------------------------------------------------------------- DBDAYSEQ, DBDAGSEQ Returns DAGBER dayseq { day in the year } takes as input day month year daycnt e.g. DBDAGSEQ result 182 DBDAYSEQ 16 10 86 result 289 DBDAGSEQ -1 -1 -1 12342 result 289 ----------------------------------------------------------------------------- DBDAYABS, DBDAGABS Returns DAGBER dagabs { (week-1)*7 + day } takes as input day month year daycnt e.g. DBDAYABS result 183 DBDAGABS 16 10 86 result 291 DBDAYABS -1 -1 -1 12342 result 291 ----------------------------------------------------------------------------- DBDAYCNT, DBDAGCNT Returns DAGBER daycnt (count since 01-01-1953) takes as input day month year daycnt e.g. DBDAGCNT result 18079 DBDAYCNT 16 10 86 result 12342 -------------------------------------------------------------------------- DBWDAG Returns DAGBER daynr converted to Dutch text takes as input day month year daycnt e.g. DBWDAG result Maandag DBWDAG 16 10 86 result Donderdag DBWDAG -1 -1 -1 12342 result Donderdag ----------------------------------------------------------------------------- DBWDAY Returns DAGBER daynr converted to English text takes as input day month year daycnt e.g. DBWDAG result Monday DBWDAG 16 10 86 result Thursday DBWDAG -1 -1 -1 12342 result Thursday ----------------------------------------------------------------------------- DBMAAN Returns DAGBER moonph converted to Dutch text takes as input day month year daycnt e.g. DBMAAN result Eerste kwatrier DBMAAN 16 10 86 result Volle maan ----------------------------------------------------------------------------- DBMOON Returns DAGBER moonph converted to English text takes as input day month year daycnt e.g. DBMOON result First quarter DBMOON 16 10 86 result Full moon ----------------------------------------------------------------------------- DBMOONPH Returns DAGBER moonph takes as input day month year daycnt e.g. DBMOON result 12 DBMOON 16 10 86 result 8 ----------------------------------------------------------------------------- DBMSYM Returns DAGBER moonph converted to a symbol takes as input day month year daycnt ù ) ù) )) [) ù[) O)) (O)) ((O)) ((O) ((O (]ù (] (( (ù ( e.g. DBMSYM result [) DBMSYM 16 10 86 result ((O)) -end--------------------------------------------------------------------------