Advanced Programming Examples
Contingent Branching
Launching a specific Procedure based on the participant’s response.
This example assumes a structure in which an input object named “participant” collects a response, and two separate List objects (List1 and List2) call separate Procedures.
'If the participant enters "1" run Procedure 1, otherwise run |
'Procedure 2. |
If participant.RESP = "1" Then |
List1.Run |
Else |
List2.Run |
End If |
Arrays
Creating a single dimension array, assigning values, and accessing values for display.
Creating and assigning calues to a single dimension array |
Dim WordList(4) As String |
Dim i As Integer |
WordList (0) = "Every" |
WordList (1) = "Good" |
WordList (2) = "Boy" |
WordList (3) = "Does" |
WordList (4) = "Fine" |
For i = 0 To 4 |
MsgBox WordList(i) |
Next i |
Debugging
Using Debug.Print to verify logging accuracy an input object named “TextStimulus” which collects a response.
Evaluate the response collected by the TextStimulus object. |
Send the response entered by the participant (RESP), the |
correct response (CRESP), and the accuracy (ACC) to the |
OUTPUT window separated by tabs. View using the DEBUG tab |
in the OUTPUT window. |
Debug.Print TextStimulus.RESP & "\t" TextStimulusStimDisplay.CRESP &_ |
"\t" & TextStimulus.ACC |
The script above will send information to the Debug tab in the Output window as follows:
See Also:
Comments
0 comments
Please sign in to leave a comment.