Calling TIME through a shell is probably a less efficient way to set the system time. It adds the overhead of loading additional copies of the Command processor and ends up requiring a response from the user, ie: "Enter new time." Generally, shelling to command.com or cmd.exe to perform practically any task is a little "left-handed" (no offense to the lefties out there). Your project leader, system administrator, teacher... whatever... is likely to give you a piece of his mind if you try to use this approach.
If you want to get fancy, you can set the time with a bit of precision by doing it the old-fashioned way... call the venerable DOS Interrupt &H21....
[tt]
DEFINT A-Z
TYPE RegTypeX
AX AS INTEGER
BX AS INTEGER
CX AS INTEGER
DX AS INTEGER
bp AS INTEGER
si AS INTEGER
di AS INTEGER
FLAGS AS INTEGER
DS AS INTEGER
ES AS INTEGER
END TYPE
DIM inregs AS RegTypeX, Outregs AS RegTypeX
Hour = 1
Minute = 2
Second = 3
OneHundredthSecond = 4
inregs.AX = &H2D00
inregs.CX = Hour * 256 + Minute
inregs.DX = Second * 256 + OneHundredthSecond
CALL INTERRUPTX(&H21, inregs, Outregs)
[/tt]
Just a note:
[tt]TIME "01:02:03"[/tt] is the easiest way to do this, since it uses a native QB command and avoids the obvious (possibly severe) problems that can occur when one calls the wrong interrupt with unknown values loaded in the registers.
Cheers.
Suffice it to say that adding disk drives and a disk operating system to a personal microcomputer is guaranteed to increase its power dramatically. CP/M and the Personal Computer
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.