Problem selecting from decks in Gambling Task...

KKat kathy.smolewska at gmail.com
Tue May 26 12:33:59 UTC 2009


Hello :)
Thank you for your response. I have double- and triple-checked this
and the attribute names match. I think it may have to do with how I've
programmed it to find Decks B, C, D.

The Decks A, B, C, D are nested under a general "Design List." Deck A
appears first, at the top of the list, and seems to work fine. It's
not until I press "f", "j", or "l" (i.e., the responses for selecting
Decks B to D) that the program fails.

Thank you for your help :)
Kathy

On May 25, 11:55 pm, KKat <kathy.smolew... at gmail.com> wrote:
> Hello,
>
> I am currently working on a modified version of the Iowa Gambling Task
> (or Bechara Gambling Task). I have created a nested design for the 4
> decks, hoping that this would allow the program to select values for
> each deck sequentially. Deck A works but not the others. I'm not sure
> what I'm doing wrong but I get the error:
> Run-time Error (Line 490)
> -990: Factor Error:
> No such attribute "varwin2"
>
> I have attached the relevant section of the script below. I'm not sure
> how to attach the .es file here.
>
> Thank you!
>
> Kathy
>
> '--------------------------------------------------------------------------
> ' Instance Declarations
> '--------------------------------------------------------------------------
> Dim Display As DisplayDevice
> Dim Sound As SoundDevice
> Dim Keyboard As KeyboardDevice
> Dim Mouse As MouseDevice
> Dim SessionProc As Procedure
>
> Dim BlockList As List
>
> Dim BlockProc As Procedure
>
> Dim TrialProc As Procedure
>
> Dim Instructions As TextDisplay
> Dim InstructionsEchoClients As EchoClientCollection
>
> Dim DesignList As List
>
> Dim DeckA As List
>
> Dim DeckB As List
>
> Dim DeckC As List
>
> Dim DeckD As List
>
> Dim FB As Slide
> Dim FB_State As SlideState
> Dim FB_SlideText As SlideText
> Dim FB_SlideImage As SlideImage
>
> Dim Goodbye As TextDisplay
>
> Dim Game As Slide
> Dim GameEchoClients As EchoClientCollection
> Dim Game_State As SlideState
> Dim Game_SlideText As SlideText
> Dim Game_SlideImage As SlideImage
>
> Dim Final As Slide
> Dim Final_State As SlideState
> Dim Final_SlideText As SlideText
>
> '--------------------------------------------------------------------------
> ' Package Declare Script
> '--------------------------------------------------------------------------
>
> '--------------------------------------------------------------------------
> ' User Script
> '--------------------------------------------------------------------------
> Dim totalsum As integer
> Dim var As integer
> Dim win As integer, loss As integer
> Dim totalsumD1 As integer
> Dim totalsumD2 As integer
> Dim totalsumD3 As integer
> Dim totalsumD4 As integer
> Dim winD1 As integer, winD2 As integer, winD3 As integer, winD4 As
> integer, lossD1 As integer, lossD2 As integer, lossD3 As integer,
> lossD4 As integer
> Dim EndTotal As integer
> Dim EndTotal2 As integer
> Dim DeckChoice As integer
> Dim Deck1, Deck2, Deck3, Deck4 As Integer
> Dim BarTotalwin As Integer
> Dim TotalGain As Integer
> Dim TotalLoss As Integer
> Dim i As Integer, y as Integer, j as Integer
>
> '--------------------------------------------------------------------------
> ' Package Global Script
> '--------------------------------------------------------------------------
>
> '--------------------------------------------------------------------------
> ' Package Routines
> '--------------------------------------------------------------------------
>
> '--------------------------------------------------------------------------
> ' Implementation
> '--------------------------------------------------------------------------
> Sub SessionProc_Run(c as Context)
>
>         '''''''''''''''''''''''''''''''''''''''''''''
>         ' InLine - Initializevariable BEGIN
>         '''''''''''''''''''''''''''''''''''''''''''''
>         Totalsum = 0
> TotalsumD1 = 0
> TotalsumD2 = 0
> TotalsumD3 = 0
> TotalsumD4 = 0
> EndTotal = 0
> EndTotal2 = 0
> BarTotalWin = 0
> TotalGain = 0
> TotalLoss = 0
>         '''''''''''''''''''''''''''''''''''''''''''''
>         ' InLine - Initializevariable END
>         '''''''''''''''''''''''''''''''''''''''''''''
>
>         Instructions.InputMasks.Reset
>
>         If Keyboard.GetState() = ebStateOpen Then
>                 InstructionsEchoClients.RemoveAll
>                 Instructions.InputMasks.Add Keyboard.CreateInputMask("{SPACE}", "",
> CLng(Instructions.Duration), CLng("1"), ebEndResponseActionTerminate,
> CLogical("Yes"), "", "", "ResponseMode:All ProcessBackspace:Yes")
>
>         End If
>
>         Instructions.Run
>         BlockList.Run c
>
>         '''''''''''''''''''''''''''''''''''''''''''''
>         ' InLine - GainOrLose BEGIN
>         '''''''''''''''''''''''''''''''''''''''''''''
>         if totalsum > 0 then
>         Final.ActiveState = "EndWin"
>         c.setAttrib "Endtotal", totalsum
> end if
> if totalsum = 0 then
>         Final.ActiveState = "EndNull"
>         c.setAttrib "EndTotal", totalsum
> end if
> if totalsum < 0 then
>         Final.ActiveState = "EndLoss"
>         c.setAttrib "EndTotal", totalsum
> end if
>         '''''''''''''''''''''''''''''''''''''''''''''
>         ' InLine - GainOrLose END
>         '''''''''''''''''''''''''''''''''''''''''''''
>
>         Select Case Final.ActiveState
>                 Case "EndWin"
>
>                         Set Final_SlideText = CSlideText(Final.States.Item("EndWin").Objects
> (1))
>                         Final_SlideText.Text = "Congratulations! You have won a total of $"
> &_
>                                 c.GetAttrib("Endtotal") &_
>                                 "."
>                         Set Final_SlideText = Nothing
>                 Case "EndLoss"
>
>                         Set Final_SlideText = CSlideText(Final.States.Item
> ("EndLoss").Objects(1))
>                         Final_SlideText.Text = "Unfortunately, you lost money!  Your total
> loss is $" &_
>                                 c.GetAttrib("EndTotal") &_
>                                 ".\n\n\n\n"
>                         Set Final_SlideText = Nothing
>                 Case "EndNull"
>
>                         Set Final_SlideText = CSlideText(Final.States.Item
> ("EndNull").Objects(1))
>                         Final_SlideText.Text = "Unfortunately, you did not win anything.
> Your final total is $" &_
>                                 c.GetAttrib("EndTotal") &_
>                                 "."
>                         Set Final_SlideText = Nothing
>         End Select
>
>         Final.Run
>
>         Goodbye.Run
>
> #If RUNTIME_VERSION_MAJOR > 1  Or (RUNTIME_VERSION_MAJOR = 1 And
> RUNTIME_VERSION_MINOR >= 2) Then
>         ' Log clock timing information
>         c.SetAttrib "Clock.Information", Clock.Information
> #End If
>
>         c.Log
> End Sub
>
> Sub BlockProc_Run(c as Context)
>         DesignList.Run c
>
>         c.Log
> End Sub
>
> Sub TrialProc_Run(c as Context)
>
>         '''''''''''''''''''''''''''''''''''''''''''''
>         ' InLine - InLineA BEGIN
>         '''''''''''''''''''''''''''''''''''''''''''''
>         c.setAttrib "totalsum", totalsum
> c.setAttrib "TotalsumD1", TotalsumD1
> c.setAttrib "TotalsumD2", TotalsumD2
> c.setAttrib "TotalsumD3", TotalsumD3
> c.setAttrib "TotalsumD4", TotalsumD4
> c.setAttrib "TotalGain", TotalGain
> c.setAttrib "TotalLoss", TotalLoss
>
>         '''''''''''''''''''''''''''''''''''''''''''''
>         ' InLine - InLineA END
>         '''''''''''''''''''''''''''''''''''''''''''''
>
>         Select Case Game.ActiveState
>                 Case "Default"
>
>                         Set Game_SlideText = CSlideText(Game.States.Item("Default").Objects
> (1))
>                         Game_SlideText.Text = "Current Total:" &_
>                                 c.GetAttrib("totalsum")
>                         Set Game_SlideText = Nothing
>
>                         Set Game_SlideText = CSlideText(Game.States.Item("Default").Objects
> (2))
>                         Set Game_SlideText = Nothing
>
>                         Set Game_SlideText = CSlideText(Game.States.Item("Default").Objects
> (3))
>                         Set Game_SlideText = Nothing
>
>                         Set Game_SlideText = CSlideText(Game.States.Item("Default").Objects
> (4))
>                         Set Game_SlideText = Nothing
>
>                         Set Game_SlideText = CSlideText(Game.States.Item("Default").Objects
> (5))
>                         Set Game_SlideText = Nothing
>
>                         Set Game_SlideImage = CSlideImage(Game.States.Item
> ("Default").Objects(6))
>                         Set Game_SlideImage = Nothing
>
>                         Set Game_SlideImage = CSlideImage(Game.States.Item
> ("Default").Objects(7))
>                         Set Game_SlideImage = Nothing
>
>                         Set Game_SlideImage = CSlideImage(Game.States.Item
> ("Default").Objects(8))
>                         Set Game_SlideImage = Nothing
>
>                         Set Game_SlideImage = CSlideImage(Game.States.Item
> ("Default").Objects(9))
>                         Set Game_SlideImage = Nothing
>
>                         Set Game_SlideText = CSlideText(Game.States.Item("Default").Objects
> (10))
>                         Set Game_SlideText = Nothing
>         End Select
>
>         Game.InputMasks.Reset
>
>         If Keyboard.GetState() = ebStateOpen Then
>                 GameEchoClients.RemoveAll
>                 Game.InputMasks.Add Keyboard.CreateInputMask("afjl", "afjl", CLng
> (Game.Duration), CLng("1"), ebEndResponseActionTerminate, CLogical
> ("Yes"), "", "", "ResponseMode:All ProcessBackspace:Yes")
>
>         End If
>
>         Game.Run
>
>         c.SetAttrib Game.Name & ".RTTime", Game.RTTime
>         c.SetAttrib Game.Name & ".RT", Game.RT
>         c.SetAttrib Game.Name & ".RESP", Game.RESP
>
> ' InLine - InLineA BEGIN
>         '''''''''''''''''''''''''''''''''''''''''''''
>         c.setAttrib "totalsum", totalsum
> c.setAttrib "TotalsumD1", TotalsumD1
> c.setAttrib "TotalsumD2", TotalsumD2
> c.setAttrib "TotalsumD3", TotalsumD3
> c.setAttrib "TotalsumD4", TotalsumD4
> c.setAttrib "TotalGain", TotalGain
> c.setAttrib "TotalLoss", TotalLoss
>
>         '''''''''''''''''''''''''''''''''''''''''''''
>         ' InLine - InLineA END
>         '''''''''''''''''''''''''''''''''''''''''''''
>
>         Select Case Game.ActiveState
>                 Case "Default"
>
>                         Set Game_SlideText = CSlideText(Game.States.Item("Default").Objects
> (1))
>                         Game_SlideText.Text = "Current Total:" &_
>                                 c.GetAttrib("totalsum")
>                         Set Game_SlideText = Nothing
>
>                         Set Game_SlideText = CSlideText(Game.States.Item("Default").Objects
> (2))
>                         Set Game_SlideText = Nothing
>
>                         Set Game_SlideText = CSlideText(Game.States.Item("Default").Objects
> (3))
>                         Set Game_SlideText = Nothing
>
>                         Set Game_SlideText = CSlideText(Game.States.Item("Default").Objects
> (4))
>                         Set Game_SlideText = Nothing
>
>                         Set Game_SlideText = CSlideText(Game.States.Item("Default").Objects
> (5))
>                         Set Game_SlideText = Nothing
>
>                         Set Game_SlideImage = CSlideImage(Game.States.Item
> ("Default").Objects(6))
>                         Set Game_SlideImage = Nothing
>
>                         Set Game_SlideImage = CSlideImage(Game.States.Item
> ("Default").Objects(7))
>                         Set Game_SlideImage = Nothing
>
>                         Set Game_SlideImage = CSlideImage(Game.States.Item
> ("Default").Objects(8))
>                         Set Game_SlideImage = Nothing
>
>                         Set Game_SlideImage = CSlideImage(Game.States.Item
> ("Default").Objects(9))
>                         Set Game_SlideImage = Nothing
>
>                         Set Game_SlideText = CSlideText(Game.States.Item("Default").Objects
> (10))
>                         Set Game_SlideText = Nothing
>         End Select
>
>         Game.InputMasks.Reset
>
>         If Keyboard.GetState() = ebStateOpen Then
>                 GameEchoClients.RemoveAll
>                 Game.InputMasks.Add Keyboard.CreateInputMask("afjl", "afjl", CLng
> (Game.Duration), CLng("1"), ebEndResponseActionTerminate, CLogical
> ("Yes"), "", "", "ResponseMode:All ProcessBackspace:Yes")
>
>         End If
>
>         Game.Run
>
>         c.SetAttrib Game.Name &
> ...
>
> read more »
--~--~---------~--~----~------------~-------~--~----~
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