TimeScaleData (Work) return - Type Mismatch

G

G Lykos

Am writing a loop to sum work per task as accessed by the captioned method
in the absence (?) of a Sum method for a collection of TimeScaleData values.

Set up a loop around a simple algorithm of TotalHours = TotalHours +
TimeScaleData(i).value. It fails on a Type Mismatch.

Have tried various types for TotalHours without success. Immediate Watch
shows an empty Set TimeScaleData item value of "", and a non-empty item
value as n.nnnnnnnn. With TotalHours defined as a variant, and the first
return TimeScaleData item of "", TotalHours was set to that.

Does a data value of "" in TimeScaleData(i).value as shown in Immediate
Watch truly signify a string, and if a variant is set equal to it, does that
fix the variant as a string variable for further computations? If so, do
you have to test each TimeScaleData(i) item to see if it's a number if you
are interested in numerical values?

Thanks for any ideas.
George
 
G

G Lykos

Please disregard - have fumbled my way through this. The TimeScaleData
(Work) Method return has to be tested for a numeric value before using it in
a calculation, because no value in a period comes back as an empty string.
I suppose in this context it's the equivalent of null, rather than zero
(i.e. zero work in the period), which would be type-consistent and perhaps
more logical.
 

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