Hi DOC,
Being as I'm lazy, and I think my idea needs less code, here's what I came up with:
code:
Break ONshell '%comspec% /c "C:\Program Files\Resource Pro Kit\uptime.exe" >C:\uptime.txt'
IF Open(1,"C:\uptime.txt") = 0
$x = ReadLine(1)
ENDIF
$ = Close(1)
$day = val(substr("$x",instr("$x","day") - 4,5))
? "$$day = " + $day
$hour = val(substr("$x",instr("$x","hour") - 3,3))
? "$$hour = " + $hour
$minute = val(substr("$x",instr("$x","minute") - 3,3))
? "$$minute = " + $minute
$second = val(substr("$x",instr("$x","second") - 3,3))
? "$$second = " + $second
Get $
The reason I wrapped the substr() in val() is 'cause I'm arbitrating the length of $day to 5 chars which could conceivably exceed 3 digits. The val() will rtrim the trailing chars. You probably want interger anyway for compares.
Be my guest and spit polish it. It's just a proof-of-concept.
HTH