The solution is mindlessly simple, and would be taught in any
Introduction to Computer Programming course, so I highly recommend that
you take such a course ASAP. Until you do that you will face many other
hurdles. Or just get out any introductory computer programming text
(try the "for Dummies" series) with any suitable language (e.g., Python,
JavaScript) and teach yourself. We are talking about learning basic
computer programming principles here.
That said, here is an example solution using If-Then:
If Slide13.RESP = "2{ENTER}" Then GoTo Label1
If Slide13.RESP = "1{ENTER}" Then GoTo Label3
GoTo Label4
Normally I would use If-Then-ElseIf there, but since each Goto already
short-circuits the If-Then sequence I left each of these as single-line
If-Thens.
Here it is using the more elegant Select Case structure (see that topic
in the E-Basic Help facility):
Select Case Slide13.RESP
Case "2{ENTER}"
GoTo Label1
Case "1{ENTER}"
GoTo Label3
Case Else
GoTo Label4
End Select
Case-Select often makes things easier to read, but in this case it does
seem a bit of overkill.
Of course, you could also simplify this by only allowing 1-character
responses in the first place, i.e., move on as soon as the subject
presses either "1" or "2". Many ways to skin this cat.
And just to grouse a little more, you should use meaningful names for
everything, instead of generic "Slide13", "Label1", etc. And you need
to learn how to properly indent your code!
And I cannot stress this enough -- please take a course in basic
computer programming.
-- David McFarlane
On 2017-10-17 8:13 AM, Bella Do wrote:
> Hello
> In my experiment, I would like to make the participants select either "1"
> or "2" before moving to the next section. If they enter any other number,
> they would have to go back to the selection page. Hence, I wrote the
> following script in Inline.
> *If Slide13.RESP = "2" + "{ENTER}" Then*
> *GoTo Label1*
> *End If *
> *If Slide13.RESP = "1" + "{ENTER}" Then *
> *GoTo Label3*
> *End If*
> *If Slide13.RESP = "12" + "{ENTER}" Then*
> *GoTo Label4*
> *End If *
> *If Slide13.RESP = "21" + "{ENTER}" Then*
> *GoTo Label4*
> *End If *
> *If Slide13.RESP = "{ENTER}" Then*
> *GoTo Label4*
> *End If *