Variables don't seem to be updating

Tyler tybeet at gmail.com
Wed Feb 9 18:58:11 UTC 2011


Thank you Susan.

Moving the declarations to the User tab in the Script window solved my
issue with trialCount not incrementing - now it's working as it
should. I've also figured out a solution to my other variables not
updating. I simply took ratingPrevious = c.GetAttrib("Rating") out of
the If statement and moved it further down in my procedure (after it
grabs the first rating) and voila! It updates and now ratingRepeat
works too!


Cheers,
Tyler



On Feb 9, 12:53 pm, Susan <susan... at gmail.com> wrote:
> Hi Tyler,
>
> I expect you're getting several replies right now, because we've all
> made the same mistake at least once. Your variables are actually
> declared within the procedure, so they get reinitialized every time
> the procedure runs and re-zeroed. You can make them global variables
> (and reset them where you need to) by putting the Dim statements in
> the user script instead of in the procedure.
>
> HTH,
> Susan
>
> On Feb 9, 11:41 am, Tyler <tyb... at gmail.com> wrote:
>
>
>
>
>
>
>
> > A related problem I am having is that I would also like to track the
> > number of trials completed.
>
> > I have a trialCount variable (Dim trialCount As Integer) and after
> > each rating scale, I have an increment (trialCount = trialCount + 1).
>
> > This is my design:http://gyazo.com/7c6a09b277aa9d502dcbb5b811dd16c2.png
> > where Inittrialcount refers to the Dim trialCount... and Increment
> > refers to trialCount + 1.
>
> > In this case, I don't see trialCount increment even once. I think
> > these issues may be related, but I'm not sure what I'm doing wrong?

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