XSetX -- Extended SET Utility VX7.00 (c) pAkUiT ICT Services 1993-2019,2023,2024 J.H.Hamakers Normal operation: ================ XSetX =[@,#] Parameters (re)defines an environment variable Win NT/2000/XP etc: ================== In Win NT/2000/XP etc. it is not possible to set variables from a program. Workaround is to use a generated Batchfile: XSetX =@ Parameters (re)defines an environment variable via XSETX.BAT Run XSETX.BAT yourself. e.g. XSETX AA=@Month Call XSETX The file is created in the current dirtectory. With the aid of the environmentvariable 'XSETX' a path can be defined: e.g. Set XSETX=C:\TEMP XSETX AA=@Month Call C:\TEMP\XSETX or Call %XSETX%\XSETX XSetX =# Parameters The same as =@ ,only the line is appended to an existing XSETX.BAT file. e.g. XSETX AA=@Month XSETX BB=#Year Call XSETX Debugging: ========= XSetX =: Parameters Just shows the result Parameters: ========== If proceded by an '@' the value is taken as the name of an environmentvariable e.g. XSETX VAR1=[@,#]Month VAR1 := a value between 1 and 12 ; representingthe current month. XSETX 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----------------------------------------------------------------------- ----------------------------------------------------------------------------- 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 NE Integer compare Ne 23 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 reports 5.0 or 6.2 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 ----------------------------------------------------------------------------- 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 --error-- when drive does not exist --nolabel-- when driva has no label ----------------------------------------------------------------------------- -Files----------------------------------------------------------------------- ----------------------------------------------------------------------------- FATTR File attributes FAttr C:\IO.SYS RHSA FILEATTR File attributes FileAttr C:\XSETX.EXE ---A FDATE File creation date FDate C:\XSETX.EXE 14-12-1993 FILEDATE File creation date FileDate C:\XSETX.FOO 00-00-0000 Assumed is that XSETX.FOO does not exists FSIZE File size FSize C:\XSETX.EXE 40860 FILESIZE File size FileSize C:\XSETX.FOO -1 Assumed is that XSETX.FOO does not exists FTIME File creation time FTime C:\XSETX.EXE 23:20:34 FILETIME File creation time FileTime C:\XSETX.FOO 00:00:00 Assumed is that XSETX.FOO does not exists READ Read from file Read 1 C:\aa.txt line1 Read 3 C:\aa.txt line3 ----------------------------------------------------------------------------- -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 ICT Services 1993-2016,2023,2024 J.H.Hamakers GREETING Gr. depend on time Greeting Good morning GROET Dutch Greeting Groet Goedemorgen VER XSETX Version Ver 7.00 VERNR XSETX Version (num) Vernr 700 VERSION XSETX Version (ext) Version XSetX -- Extended SET Utility VX7.00 ----------------------------------------------------------------------------- -DAGBER-functions------------------------------------------------------------ ----------------------------------------------------------------------------- DAGBER (Day calculation) These functions make use of the DAGBER routine: DagBer(Day,Month,Year,YrFull,DaYNr,WeekNr,DaySeq,DayAbs,DayCnt,Moonph,Error) Range: 1953 ... 2052 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 (2 = 1982, 10 = 2010) DagNr : Daynumber ( 1 ... 7 , 1 = monday) WeekNr : Weeknumber ( 1 ... 53 ) DagSeq : Daynumber in the year. January 1st = 1 DagAbs : Daynumber (((Weeknr-1) * 7) + daynr) MoonPh : Moonphase (0 ... 15) 0 = New moon 4 = First quarter 8 = Full moon 12 = Last quarter ----------------------------------------------------------------------------- DAGBER takes as input day month year daycnt returns DAGBER string day-month-year-yrfull-daynr-weeknr-dayseq-dayabs-daycnt-moonph 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. DBWDAY result Monday DBWDAY 16 10 86 result Thursday DBWDAY -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. DBMOONPH result 12 DBMOONPH 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-------------------------------------------------------------------------