T
Thomas V
Hi,
I need to programmatically determine if a resource is 100% available
for the duration of a task.
The following code will do the job using TimeScaleData but it's far
from optimal since the timescale is pjTimescaleMinutes which gets
pretty intense to run on long tasks.
Is there a more optimal way to determine this?
Private Function isResourceAvailable(tskT As Task, resR As Resource)
As Boolean
Dim rTSV As TimeScaleValues, i As Long
isResourceAvailable = True
Set rTSV = resR.TimeScaleData(tskT.Start, tskT.Finish,
pjResourceTimescaledRemainingAvailability, pjTimescaleMinutes)
For i = 1 To rTSV.Count
If rTSV.Item(i).value <> 1 And rTSV.Item(i).value <> "" Then
isResourceAvailable = False
Exit For
End If
Next i
End Function
Thanks!
I need to programmatically determine if a resource is 100% available
for the duration of a task.
The following code will do the job using TimeScaleData but it's far
from optimal since the timescale is pjTimescaleMinutes which gets
pretty intense to run on long tasks.
Is there a more optimal way to determine this?
Private Function isResourceAvailable(tskT As Task, resR As Resource)
As Boolean
Dim rTSV As TimeScaleValues, i As Long
isResourceAvailable = True
Set rTSV = resR.TimeScaleData(tskT.Start, tskT.Finish,
pjResourceTimescaledRemainingAvailability, pjTimescaleMinutes)
For i = 1 To rTSV.Count
If rTSV.Item(i).value <> 1 And rTSV.Item(i).value <> "" Then
isResourceAvailable = False
Exit For
End If
Next i
End Function
Thanks!