Lag property

D

Dilbert

What is the time unit of Lag property ?

I am using "Lag" inside a loop of TaskDependencies.

My actual conclusion is that unit is in minutes when the lag/lead time are specified
in time units (p. ex. "d" or "ed"). Is this correct ?
But when Lag is specified in percent the results are strange!

Thanks in advance

Wilmar
 
W

Wilmar C. Degobbi

Trying to clarify my doubt...
In MSDN we read:

Lag Property
The duration of lag time between linked tasks.
To specify lead time between tasks, use a negative value.
String values default to days unless otherwise specified.
Non-string values are interpreted as minutes. Read/write Variant.

When I read Lag property the result are always in number, not in string ?!

Wilmar

---


What is the time unit of Lag property ?

I am using "Lag" inside a loop of TaskDependencies.

My actual conclusion is that unit is in minutes when the lag/lead time are specified
in time units (p. ex. "d" or "ed"). Is this correct ?
But when Lag is specified in percent the results are strange!

Thanks in advance

Wilmar
 
J

Jack Dahlgren

I think through VBA it is always in minutes.
That has been my experience.
Entering lag in the edit dependencies box is typically in days.

-Jack Dahlgren
 
W

Wilmar C. Degobbi

Jack, thanks for the answer.

Please consider that I am only reading the lags, not writing.

If my actual conclusions is right, the lag read (*) not represents
the real time (in minutes, how you said) when the inputed
lag was in "%". When the inputed was in time unit, OK.

If this conclusion is right (I am confused...),
should be have a read "flag" p.ex., indicating the condition that
lag was inputed in "%" to possibility treating the number obtained ?
Or No ?

If you or somebody could help me I would apreciate.

(*) I am using:
..
..
Set Ativ_Selec = ActiveSelection.Tasks(1)
..
..
For each Ativ_pred in Ativ_Selec.TaskDependencies
..
Latencia = Ativ_pred.Lag
[and for testing typing the Latencia for differents predecessors]
..
Next Ativ_pred

Thanks,

Wilmar

---

I think through VBA it is always in minutes.
That has been my experience.
Entering lag in the edit dependencies box is typically in days.

-Jack Dahlgren
 
J

John

Wilmar C. Degobbi said:
Jack, thanks for the answer.

Please consider that I am only reading the lags, not writing.

If my actual conclusions is right, the lag read (*) not represents
the real time (in minutes, how you said) when the inputed
lag was in "%". When the inputed was in time unit, OK.

If this conclusion is right (I am confused...),
should be have a read "flag" p.ex., indicating the condition that
lag was inputed in "%" to possibility treating the number obtained ?
Or No ?

If you or somebody could help me I would apreciate.

(*) I am using:
.
.
Set Ativ_Selec = ActiveSelection.Tasks(1)
.
.
For each Ativ_pred in Ativ_Selec.TaskDependencies
.
Latencia = Ativ_pred.Lag
[and for testing typing the Latencia for differents predecessors]
.
Next Ativ_pred

Thanks,

Wilmar

Wilmar,
If I may interject. Unfortunately the lag property is not consistent in
the data it provides. This is one case where the value read using VBA IS
dependent on how lag was input by the user. The VBA help file says that
string values default to days while non-string values are in minutes.
I'm not sure what that really means because it doesn't appear consistent
with how it actually works in real lines of code. If lag is input as a
percentage, the lag property, when read using VBA, will be given as an
integer value of the percentage divided by 10. For example, if the lag
is 25%, the value will be 2. Not very useful in my opinion.

For all other lag entries (e.g. 5 days, 5 minutes), the value provided
will be in minutes. For example, 5 days will be 2400 minutes, assuming a
standard 8 hour work day.

In my opinion when the TaskDependencies object was added to the Project
object model, it was not done very well. When I need to obtain link
modifier information, I decode the predecessor text string. Indeed, it
takes more lines of code but once the decoding algorithm is developed,
it gives consistent results.

John
Project MVP
 
W

Wilmar C. Degobbi

John,

Thank you very much for your interjection, hehehe.

The answer help me a lot. The ideia to use predecessor text string
to treat the lags is very good - I didn't think in this possibility.

Regards,


Wilmar

---

Wilmar,
If I may interject. Unfortunately the lag property is not consistent in
the data it provides. This is one case where the value read using VBA IS
dependent on how lag was input by the user. The VBA help file says that
string values default to days while non-string values are in minutes.
I'm not sure what that really means because it doesn't appear consistent
with how it actually works in real lines of code. If lag is input as a
percentage, the lag property, when read using VBA, will be given as an
integer value of the percentage divided by 10. For example, if the lag
is 25%, the value will be 2. Not very useful in my opinion.

For all other lag entries (e.g. 5 days, 5 minutes), the value provided
will be in minutes. For example, 5 days will be 2400 minutes, assuming a
standard 8 hour work day.

In my opinion when the TaskDependencies object was added to the Project
object model, it was not done very well. When I need to obtain link
modifier information, I decode the predecessor text string. Indeed, it
takes more lines of code but once the decoding algorithm is developed,
it gives consistent results.

John
Project MVP
 
J

John

Wilmar C. Degobbi said:
John,

Thank you very much for your interjection, hehehe.

The answer help me a lot. The ideia to use predecessor text string
to treat the lags is very good - I didn't think in this possibility.

Regards,


Wilmar
Wilmar,
Good luck with your decoding and thanks for your feedback.

John
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top