>>> Continued from previous message
'=============================================================================
SUB SetDateTime (BYVAL Handle%, BYVAL DateNum??, BYVAL TimeNum??)
'=============================================================================
ASM Mov AX, &H5701
ASM Mov BX, Handle%
ASM Mov CX, TimeNum??
ASM Mov DX, DateNum??
ASM Int &H21
ASM Jnc NoError
Report "Error in DOS set date/time function."
END 1
NoError:
END SUB
'=============================================================================
FUNCTION CountFiles% (FSpec$)
'=============================================================================
Count% = 0
Temp$ = DIR$(FSpec$)
DO WHILE LEN(Temp$)
INCR Count%
Temp$ = DIR$
LOOP
CountFiles% = Count%
END FUNCTION
'=============================================================================
SUB FillFiles (FSpec$, FArray$())
'=============================================================================
Top% = UBOUND(FArray$)
FArray$(1) = DIR$(FSpec$)
IF Top% > 1 THEN
FOR Count% = 2 TO Top%
FArray$(Count%) = DIR$
NEXT Count%
END IF
END SUB
'=============================================================================
SUB ShowHelpMessage
'=============================================================================
Report ""
Report " Useage: TOUCH filespec datespec timespec"
Report ""
Report " filespec: may be any valid DOS filespec, including wildcards."
Report " datespec: may be in the format mm/dd/yy[yy] or mm-dd-yy[yy]."
Report " timespec: may be in the format hh:mm or hh:mm:ss."
Report ""
Report " TOUCH.EXE changes the date/time stamp of the file(s) specified"
Report " by filespec, to match the specs given in datespec and timespec."
Report ""
Report " If all 3 parameters are not given, this help screen appears."
Report ""
END 1
END SUB
'=============================================================================
SUB Report (Message$)
'=============================================================================
PRINT #StdOut, Message$
END SUB
'=============================================================================
FUNCTION ArgC% ()
'=============================================================================
Cmd$ = COMMAND$
Delim$ = " " ' use a space char as delimiter
ArgCount% = 0 ' make these explicit
Index% = 0 ' even though they'd be zero, anyway
DO
IF LEN(Tokenize$(Cmd$, Delim$, Index%)) THEN
INCR ArgCount%
ELSE
EXIT LOOP
END IF
LOOP
ArgC% = ArgCount%
END FUNCTION
'=============================================================================
FUNCTION ArgV$ (ArgNum%)
'=============================================================================
IF ISTRUE(ArgNum% > ArgC%) OR ISTRUE(ArgNum% < 1) THEN
ArgV$ = ""
EXIT FUNCTION
END IF
Cmd$ = COMMAND$
Delim$ = " "
Index% = 0
FOR X% = 1 TO ArgNum%
Arg$ = Tokenize$(Cmd$, Delim$, Index%)
NEXT X%
ArgV$ = Arg$
END FUNCTION
'=============================================================================
FUNCTION Tokenize$ (Source$, Delim$, Index%)
'=============================================================================
DIM Count AS LOCAL INTEGER 'keeps count of chars between delimiters
'offset of first tested char during this call
DIM FirstChar AS LOCAL INTEGER
DIM LocalIndex AS LOCAL INTEGER 'an index we can manipulate freely
DIM Returned AS LOCAL STRING
Returned = ""
Count = 0
LocalIndex = Index%
FirstChar = 0
ASM Push DS
ASM Push SI
ASM Push DI
ASM Les BX, Index%
ASM Mov SI, ES:[BX] ; SI = Index% value
ASM Les BX, Delim$ ; ES:BX = address of Delim$ handle
ASM Mov AX, ES:[BX] ; AX = Delim$ handle
ASM Push AX
ASM Call GETSTRLOC ; puts Delim$ address IN DX:AX, length IN CX
ASM Push DX ; save Delim$ segment on stack
ASM Push AX ; save offset of Delim$ first Byte on stack
ASM Push CX ; save CX (length of Delim$) on stack
ASM Les BX, Source$ ;ES:BX = address of Source$ handle
ASM Mov AX, ES:[BX] ; AX = handle of Source$
ASM Mov BX, AX ; make a copy of AX IN BX
>>> Continued to next message
--- WILDMAIL!/WC v4.12
---------------
* Origin: Com-Dat BBS - Hillsboro, OR. HST DS (1:105/314.0)
|