Run-time Error - "no such attribute"

David McFarlane mcfarla9 at msu.edu
Mon Jun 22 18:46:43 UTC 2009


Kathy,

I would check your code again.  Although the attribute "varwin1II" 
may exist (as evidenced by success in the first instance), the error 
message indicates that the attribute "varwin4II" does not exist.  So 
please look again and make sure that you have indeed defined 
"varwin4II" at a time prior to the failing line.  Also, exactly where 
is line 962, that might help us to inspect your script sample?

Also, you might go to the PST Forum and run a search using the term 
"no such attribute", I believe others have asked a similar question 
and you might get some clues there, although I don't know if it will 
exactly address your problem.

Good luck,
-- David McFarlane, Professional Faultfinder


>Hello :)
>
>I am trying to figure out why I am getting the following error when I
>try to run my script:
>
>Run-time Error (Line 962)
>-990: Factor Error:
>No such attribute "varwin4II"
>
>I do NOT get this error for the first instance of the script [winII =
>c.getAttrib("varwin1II")] but it comes up every time I press a
>response button other than "a" (i.e., f, j, l). The attribute DOES
>exist, so I'm not sure what is going wrong. I included the relevant
>section of the script below. I don't know if this is important or not
>but I am using LABELS and I noticed the following noted on the script
>but I'm not sure if it has anything to do with my current error:
>Endlabel2:
>         If Err.Number = ebInputAccepted Then
>                 Err.Clear
>                 Resume Endlabel2Resume
>         ElseIf Err.Number <> 0 Then
>                 'NOTE: If you receive a runtime error here, it
>                 ' is because a runtime error other than ebInputAccepted
>                 ' was thrown (ebInputAccepted for catching input 
> masks that jump).
>                 'You are encouraged to either handle the error so that
>                 ' it is not thrown in the future or will have to set up
>                 ' your own error handler, which will also need to take
>                 ' into account for any input masks that jump.
>                 '
>                 'Raise the error so the default error handler will 
> show the message
>                 Err.Raise Err.Number, Err.Source, Err.Description
>         End If
>
>Sub respproc2_Run(c as Context)
>
>         '''''''''''''''''''''''''''''''''''''''''''''
>         ' InLine - Choose1234II BEGIN
>         '''''''''''''''''''''''''''''''''''''''''''''
>         If game2.RESP = "a" then
>         FB2.ActiveState = "f12"
>         winII = c.getAttrib("varwin1II")
>         lossII = c.getAttrib("varloss1II")
>         totalsumII = totalsumII + winII + lossII
>         TotalGainII = TotalGainII + winII
>         TotalLossII= TotalLossII + lossII
>         c.setAttrib "TotalsumII", TotalsumII
>         c.setAttrib "AmountWonII", winII
>         c.setAttrib "AmountLostII", lossII
>         c.setAttrib "TotalGainII", TotalGainII
>         c.setAttrib "TotalLossII", TotalLossII
>         c.setAttrib "DeckChoiceII", 1
>         winD1II = c.getAttrib("varwin1II")
>         lossD1II = c.getAttrib("varloss1II")
>         TotalsumD1II = totalsumD1II + winD1II + lossD1II
>         c.setAttrib "TotalsumD1II", TotalsumD1II
>     c.setAttrib "BarWinII", BarWinII
>
>         If totalsumII > 0 then
>         BarWinII = TotalSumII/5
>         Else BarWinII = 0
>         End If
>
>
>elseif game2.RESP = "f" then
>         FB2.ActiveState = "f22"
>     winII = c.getAttrib("varwin2II")
>         lossII = c.getAttrib("varloss2II")
>         totalsumII = totalsumII + winII + lossII
>         TotalGainII = TotalGainII + winII
>         TotalLossII = TotalLossII + lossII
>         c.setAttrib "TotalsumII", TotalsumII
>         c.setAttrib "AmountWonII", winII
>         c.setAttrib "AmountLostII", lossII
>         c.setAttrib "TotalGainII", TotalGainII
>         c.setAttrib "TotalLossII", TotalLossII
>         c.setAttrib "DeckChoiceII", 2
>         winD2II = c.getAttrib("varwin2II")
>         lossD2II = c.getAttrib("varloss2II")
>         TotalsumD2II = totalsumD2II + winD2II + lossD2II
>         c.setAttrib "TotalsumD2II", TotalsumD2II
>     c.setAttrib "BarWinII", BarWinII
>
>         If totalsumII > 0 then
>         BarWinII = TotalSumII/5
>         Else BarWinII = 0
>         End If
>
>elseif game2.RESP = "j" then
>         FB2.ActiveState = "f32"
>     winII = c.getAttrib("varwin3II")
>         lossII = c.getAttrib("varloss3II")
>         totalsumII = totalsumII + winII + lossII
>         TotalGainII = TotalGainII + winII
>         TotalLossII = TotalLossII + lossII
>         c.setAttrib "TotalsumII", TotalsumII
>         c.setAttrib "AmountWonII", winII
>         c.setAttrib "AmountLostII", lossII
>         c.setAttrib "TotalGainII", TotalGainII
>         c.setAttrib "TotalLossII", TotalLossII
>         c.setAttrib "DeckChoiceII", 3
>         winD3II = c.getAttrib("varwin3II")
>         lossD3II = c.getAttrib("varloss3II")
>         TotalsumD3II = totalsumD3II + winD3II + lossD3II
>         c.setAttrib "TotalsumD3II", TotalsumD3II
>     c.setAttrib "BarWinII", BarWinII
>
>         If totalsumII > 0 then
>         BarWinII = TotalSumII/5
>         Else BarWinII = 0
>         End If
>
>elseif game2.RESP = "l" then
>         FB2.ActiveState = "f42"
>         winII = c.getAttrib("varwin4II")
>         lossII = c.getAttrib("varloss4II")
>         totalsumII = totalsumII + winII + lossII
>         TotalGainII = TotalGainII + winII
>         TotalLossII = TotalLossII + lossII
>         c.setAttrib "TotalsumII", TotalsumII
>         c.setAttrib "AmountWonII", winII
>         c.setAttrib "AmountLostII", lossII
>         c.setAttrib "TotalGainII", TotalGainII
>         c.setAttrib "TotalLossII", TotalLossII
>         c.setAttrib "DeckChoiceII", 4
>         winD4II = c.getAttrib("varwin4II")
>         lossD4II = c.getAttrib("varloss4II")
>         TotalsumD4II = totalsumD4II + winD4II + lossD4II
>         c.setAttrib "TotalsumD4II", TotalsumD4II
>     c.setAttrib "BarWinII", BarWinII
>
>         If totalsumII > 0 then
>         BarWinII = TotalSumII/5
>         Else BarWinII = 0
>         End If
>End If
>
>Thank you :)
>Kathy
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "E-Prime" group.
To post to this group, send email to e-prime at googlegroups.com
To unsubscribe from this group, send email to e-prime+unsubscribe at googlegroups.com
For more options, visit this group at http://groups.google.com/group/e-prime?hl=en
-~----------~----~----~----~------~----~------~--~---



More information about the Eprime mailing list