Variables don't seem to be updating

Tyler tybeet at gmail.com
Wed Feb 9 16:33:01 UTC 2011


I have an experiment that presents a stimulus, and captures a rating
on 5 Likert scales before presenting a new stimulus.
I would like to track ratings to prevent subjects from mindlessly
clicking the same rating over and over.

So basically I need to declare two variables:
ratingPrevious - which holds the value of the previous rating
ratingRepeat - which counts if a rating is repeated and how many times

So I begin with this inside my procedure:

     Dim ratingRepeat As Integer
     Dim ratingPrevious As Integer

     If c.GetAttrib("Rating") > 0 Then
        	ratingPrevious = c.GetAttrib("Rating")
     End If

Immediately after my script that captures a rating and places it in
the Rating attribute I have this:

     If ratingPrevious = c.GetAttrib("Rating") Then
     		     ratingRepeat = ratingRepeat + 1
     ElseIf ratingPrevious <> c.GetAttrib("Rating") Then
		     ratingRepeat = 0
     End If

And then for debugging purposes I have a script that tells me what
these values are:

     cnvs.Text sX, sY, c.GetAttrib("Rating")
     cnvs.Text sX, sY, ratingRepeat
     cnvs.Text sX, sY, ratingPrevious

The behaviour that I observe is that ratingPrevious is capturing the
very first rating, but then it stops being updated with additional
ratings.
In addition, regardless of whether the current and previous ratings
are equal, ratingRepeat never gets incremented beyond the first time
that it reads Rating = ratingPrevious, so it gets stuck at "1".

You can see the structure of my design here:
http://gyazo.com/5e6f1f8c7f87ed02a84e90e708c5c248.png

Snippet 1, Snippet 2, and Snippet 3 correspond to the code I pasted
above. Clearly, the program is reading these pieces of code because
it's presenting the scales, and for each rating after the first one
the value of Rating is necessarily greater than 0, so it should be
processing the part that updates ratingPrevious (ratingPrevious =
c.GetAttrib("Rating")). So why isn't this value changing?

My feeling is that it is only satisfying these If statements once, and
then ignoring them thereafter.

Does anyone have any ideas?

-- 
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