Hello,
I am using VB6.0 and consider myself to pretty good in it, however, I have stumbled across a problem which really eludes me. I need to convert a double format to a time format.
Let me give you an example
====================
lpResTotal(0) = "123/1000"
lpResTotal(1) = "145/1230"
lpResTotal(2) = "999/10239"
lpResTotal(3) = "1230/1230"
lpResPerHour(0) = "330"
lpResPerHour(1) = "390"
lpResPerHour(2) = "130"
lpResPerHour(3) = "3300"
Dim sSplitTest() As String
For i = 0 To 3
sSplitTest() = Split(lblResTotal(i).Caption, "/")
If sSplitTest(0) <> sSplitTest(1) Then
' Firstly, let's get the current count of resources
lpCurAmmount = sSplitTest(1) - sSplitTest(0)
' Let's divide this by the resources per hour to give us how many hours are needed
lpResNeeded_hour = Int(lpCurAmmount / Replace(Replace(lblResPerHour(i).Caption... "(+ ", ""), " / hour)", ""))
lpResNeeded_mins = "Don't know what this should be"
lpResNeeded_secs = "Don't know what is supposed to be here"
lblResFillTime(i).Caption = lpResNeeded_hour & ":" & lpResNeeded_mins & ":" lblResNeeded_secs
Else
lblResFillTime(i).Caption = "Res finished"
End If
Next i
====================
Let me show you what you should be seeing:
Example:
lpResTotal = "317/1200"
lpResFin = 2:40:06
Tags: