• Welcome to Valhalla Legends Archive.
 

Idles...

Started by PsYcHiC, July 08, 2003, 08:23 PM

Previous topic - Next topic

Camel

Yeah, sorry; I was feeling a little...eh...when I posted that.

JoeCool

nice big ass code
Quote
Public Function UpTime() As String
   Dim ticks As Long
   ticks = GetTickCount
   UpTime = "Computer on for " & GetTime(ticks) & _
           ", running for " & GetTime(ticks - StartTime) & _
           ", logged on for " & GetTime(ticks - LogTime)
End Function

Public Function Zero(str As String, Count As Long, Optional Char As Byte = "0") As String
   Zero = String(Count - Len(str), CStr(Char)) & str
End Function

Public Function GetTime(ByVal ticks As Long, Optional ShowDecimals As Boolean = False) As String
   Dim TS As Long, TM As Long, TH As Long, TD As Long, TW As Long

   TS = ticks \ 1000: ticks = ticks - TS * 1000
   TM = TS \ 60:            TS = TS - TM * 60
   TH = TM \ 60:            TM = TM - TH * 60
   TD = TH \ 24:            TH = TH - TD * 24
   TW = TD \ 7:            TD = TD - TW * 7
   
   GetTime = Zero(CStr(TS), 2) & IIf(ShowDecimals, "." & Zero(CStr(ticks), 3), "") & "s"
   If TM + TH + TD + TW > 0 Then GetTime = Zero(CStr(TM), 2) & "m " & GetTime
   If TH + TD + TW > 0 Then GetTime = Zero(CStr(TH), 2) & "h " & GetTime
   If TD + TW > 0 Then GetTime = CStr(TD) & "d " & GetTime
   If TW > 0 Then GetTime = CStr(TW) & "w " & GetTime
End Function
by any change, what name would i name the "timer" :/ and is it for cbs and what would i put under UserTalk

Access=RetrieveAccess(Access,Username)
If Access= "M" Then
??????