After adding a single param to the end of an object constructor, I started to get an debug error message "Expression cannot be evaluated at this time" when I tried to watch the value of ANY variable when stepping through the procedure that invoked the object.
The constructor originally had several parameters. Adding adding a single DECIMAL type param, I got this strange behavior. I noticed that if I changed the param type to DOUBLE< everything worked fine.
Someone else also had this problem but I saw no explanation or practical resolution. This info follows at the end of this posting.
Here is the definition f the constructor: Note that the problem only developed after furst displaying a returned dataset result in the calling routine.
If I change the variable "WeightedHealth " to a Double, I do not have the problem.
What's up with this?
Friend Sub New(ByVal AccessMode As AccessMode, _
ByVal StrategyKpiMeas ureId As Integer, _
ByVal AccountId As Integer, _
ByVal ReportingPeriod TypeId As ReportingPeriod Type, _
ByVal StrategyId As Integer, _
ByVal SkpiId As Integer, _
ByVal MeasureValue As Double, _
ByVal EntryDate As Date, _
ByVal IsOfficial As Boolean, _
ByVal IsPublished As Boolean, _
ByVal AssociatedTarge t As Target, _
ByVal InterimTargetVa lue As Double, _
ByVal MarginalInterim TargetValue As Double, _
ByVal MarginalEndValu e As Double, _
ByVal Health As SkpiHealth, _
ByVal MeasureOwnerId As Integer, _
ByVal MeasureOwnerFir stName As String, _
ByVal MeasureOwnerLas tName As String, _
ByVal WeightedHealth As Double)
''......
End Sub
Private Sub PopulateObjects FromDataset()
Dim drwMeasure As DataRow
Dim AssociatedTarge t As Target
Dim MarginalInterim Target As Double
Dim InterimTargetVa lue As Double
Dim MarginalEndValu e As Double
Dim Margin As Double
Dim WeightedHealth As Double
Dim i As Integer
i = 0
For Each drwMeasure In m_dtbMeasures.R ows
'Calculate the Health weight of the metric.
'For each of the relevant flags that are set, sum SKPI Class Weight values.
WeightedHealth = CType(drwMeasur e("CenterOfMass "), Short) * CType(m_dtbSkpi ClassWeights.Ro ws.Find("Center of Mass").Item("Cl assWeight"), Double) + _
CType(drwMeasur e("CriticalOutc ome"), Short) * CType(m_dtbSkpi ClassWeights.Ro ws.Find("Critic al Outcome").Item( "ClassWeigh t"), Double) + _
CType(drwMeasur e("ManagementPr essurePoint"), Short) * CType(m_dtbSkpi ClassWeights.Ro ws.Find("Manage ment Pressure Point").Item("C lassWeight"), Double)
If IsDBNull(drwMea sure("StrategyS kpiTargetId")) Then
AssociatedTarge t = Nothing
MarginalInterim Target = Double.MinValue
InterimTargetVa lue = Double.MinValue
MarginalEndValu e = Double.MinValue
Margin = Double.MinValue
Else
AssociatedTarge t = New Target(CType(Ac cessMode, AccessMode), _
CType(drwMeasur e("StrategySkpi TargetId"), Integer), _
CType(drwMeasur e("StrategyId") , Integer), _
m_AccountId, _
CType(drwMeasur e("SkpiId"), Integer), _
CType(drwMeasur e("EffectiveDat e"), Date), _
CType(drwMeasur e("TargetValue" ), Double), _
CType(drwMeasur e("TargetStartD ate"), Date), _
CType(drwMeasur e("TargetStartV alue"), Double), _
m_AdjustedSyste mDateTime, _
CType(drwMeasur e("TargetTypeId "), TargetType), _
CType(drwMeasur e("TargetTypeDe sc"), String), _
"", _
Margin)
MarginalInterim Target = CType(drwMeasur e("MarginalInte rimTarget"), Double)
InterimTargetVa lue = CType(drwMeasur e("InterimTarge tValue"), Double)
MarginalEndValu e = CType(drwMeasur e("MarginalEndV alue"), Double)
End If
If IsDBNull(drwMea sure("MarginalI nterimTarget")) Then
MarginalInterim Target = Double.MinValue
Else
MarginalInterim Target = CType(drwMeasur e("MarginalInte rimTarget"), Double)
End If
Dim Measure As New Measure(CType(A ccessMode, AccessMode), _
CType(drwMeasur e("StrategyKpiM easureId"), Integer), _
m_AccountId, _
m_ReportingPeri odTypeId, _
m_StrategyId, _
CType(drwMeasur e("SkpiId"), Integer), _
CType(drwMeasur e("SkpiValue" ), Double), _
CType(drwMeasur e("EntryDate" ), Date), _
CType(drwMeasur e("IsOffical" ), Boolean), _
CType(drwMeasur e("IsPublished" ), Boolean), _
AssociatedTarge t, _
InterimTargetVa lue, _
MarginalInterim Target, _
MarginalEndValu e, _
CType(drwMeasur e("SkpiHealth") , SkpiHealth), _
CType(drwMeasur e("MeasureOwner Id"), Integer), _
drwMeasure("Mea sureOwnerFirstN ame").ToString , _
drwMeasure("Mea sureOwnerLastNa me").ToString , _
WeightedHealth)
m_MeasureCollec tion.Add(Measur e, CType(drwMeasur e("StrategyKpiM easureId"), Integer).ToStri ng)
Next
End Sub
4/27/2004 10:44:53 AM Expression Cannot Be Evaluated at this time
While debugging an application, whenever i enter into a specific function,
all watch values refering to this function get the error message:
"Expression Cannot Be evaluated at this Time". The function works and does
everything it's supposed to but it seems i just can't wiew watch values
within that function. Anyone?
4/27/2004 11:00:25 AM Re: Expression Cannot Be Evaluated at this time Answering my own question:
Still weird behaviour but it was simply that one of the methods used within
that function was declared as a Function instead of Sub even though it did
not actually return anything.
"lp" <louis.p.dauphi nais@americdisc .com> wrote in message
news:Q8adnSWiEv V77BPdRVn-vw@giganews.com ...
The constructor originally had several parameters. Adding adding a single DECIMAL type param, I got this strange behavior. I noticed that if I changed the param type to DOUBLE< everything worked fine.
Someone else also had this problem but I saw no explanation or practical resolution. This info follows at the end of this posting.
Here is the definition f the constructor: Note that the problem only developed after furst displaying a returned dataset result in the calling routine.
If I change the variable "WeightedHealth " to a Double, I do not have the problem.
What's up with this?
Friend Sub New(ByVal AccessMode As AccessMode, _
ByVal StrategyKpiMeas ureId As Integer, _
ByVal AccountId As Integer, _
ByVal ReportingPeriod TypeId As ReportingPeriod Type, _
ByVal StrategyId As Integer, _
ByVal SkpiId As Integer, _
ByVal MeasureValue As Double, _
ByVal EntryDate As Date, _
ByVal IsOfficial As Boolean, _
ByVal IsPublished As Boolean, _
ByVal AssociatedTarge t As Target, _
ByVal InterimTargetVa lue As Double, _
ByVal MarginalInterim TargetValue As Double, _
ByVal MarginalEndValu e As Double, _
ByVal Health As SkpiHealth, _
ByVal MeasureOwnerId As Integer, _
ByVal MeasureOwnerFir stName As String, _
ByVal MeasureOwnerLas tName As String, _
ByVal WeightedHealth As Double)
''......
End Sub
Private Sub PopulateObjects FromDataset()
Dim drwMeasure As DataRow
Dim AssociatedTarge t As Target
Dim MarginalInterim Target As Double
Dim InterimTargetVa lue As Double
Dim MarginalEndValu e As Double
Dim Margin As Double
Dim WeightedHealth As Double
Dim i As Integer
i = 0
For Each drwMeasure In m_dtbMeasures.R ows
'Calculate the Health weight of the metric.
'For each of the relevant flags that are set, sum SKPI Class Weight values.
WeightedHealth = CType(drwMeasur e("CenterOfMass "), Short) * CType(m_dtbSkpi ClassWeights.Ro ws.Find("Center of Mass").Item("Cl assWeight"), Double) + _
CType(drwMeasur e("CriticalOutc ome"), Short) * CType(m_dtbSkpi ClassWeights.Ro ws.Find("Critic al Outcome").Item( "ClassWeigh t"), Double) + _
CType(drwMeasur e("ManagementPr essurePoint"), Short) * CType(m_dtbSkpi ClassWeights.Ro ws.Find("Manage ment Pressure Point").Item("C lassWeight"), Double)
If IsDBNull(drwMea sure("StrategyS kpiTargetId")) Then
AssociatedTarge t = Nothing
MarginalInterim Target = Double.MinValue
InterimTargetVa lue = Double.MinValue
MarginalEndValu e = Double.MinValue
Margin = Double.MinValue
Else
AssociatedTarge t = New Target(CType(Ac cessMode, AccessMode), _
CType(drwMeasur e("StrategySkpi TargetId"), Integer), _
CType(drwMeasur e("StrategyId") , Integer), _
m_AccountId, _
CType(drwMeasur e("SkpiId"), Integer), _
CType(drwMeasur e("EffectiveDat e"), Date), _
CType(drwMeasur e("TargetValue" ), Double), _
CType(drwMeasur e("TargetStartD ate"), Date), _
CType(drwMeasur e("TargetStartV alue"), Double), _
m_AdjustedSyste mDateTime, _
CType(drwMeasur e("TargetTypeId "), TargetType), _
CType(drwMeasur e("TargetTypeDe sc"), String), _
"", _
Margin)
MarginalInterim Target = CType(drwMeasur e("MarginalInte rimTarget"), Double)
InterimTargetVa lue = CType(drwMeasur e("InterimTarge tValue"), Double)
MarginalEndValu e = CType(drwMeasur e("MarginalEndV alue"), Double)
End If
If IsDBNull(drwMea sure("MarginalI nterimTarget")) Then
MarginalInterim Target = Double.MinValue
Else
MarginalInterim Target = CType(drwMeasur e("MarginalInte rimTarget"), Double)
End If
Dim Measure As New Measure(CType(A ccessMode, AccessMode), _
CType(drwMeasur e("StrategyKpiM easureId"), Integer), _
m_AccountId, _
m_ReportingPeri odTypeId, _
m_StrategyId, _
CType(drwMeasur e("SkpiId"), Integer), _
CType(drwMeasur e("SkpiValue" ), Double), _
CType(drwMeasur e("EntryDate" ), Date), _
CType(drwMeasur e("IsOffical" ), Boolean), _
CType(drwMeasur e("IsPublished" ), Boolean), _
AssociatedTarge t, _
InterimTargetVa lue, _
MarginalInterim Target, _
MarginalEndValu e, _
CType(drwMeasur e("SkpiHealth") , SkpiHealth), _
CType(drwMeasur e("MeasureOwner Id"), Integer), _
drwMeasure("Mea sureOwnerFirstN ame").ToString , _
drwMeasure("Mea sureOwnerLastNa me").ToString , _
WeightedHealth)
m_MeasureCollec tion.Add(Measur e, CType(drwMeasur e("StrategyKpiM easureId"), Integer).ToStri ng)
Next
End Sub
4/27/2004 10:44:53 AM Expression Cannot Be Evaluated at this time
While debugging an application, whenever i enter into a specific function,
all watch values refering to this function get the error message:
"Expression Cannot Be evaluated at this Time". The function works and does
everything it's supposed to but it seems i just can't wiew watch values
within that function. Anyone?
4/27/2004 11:00:25 AM Re: Expression Cannot Be Evaluated at this time Answering my own question:
Still weird behaviour but it was simply that one of the methods used within
that function was declared as a Function instead of Sub even though it did
not actually return anything.
"lp" <louis.p.dauphi nais@americdisc .com> wrote in message
news:Q8adnSWiEv V77BPdRVn-vw@giganews.com ...