If then and loops

Peter Quain pquain at une.edu.au
Thu Oct 20 06:33:27 UTC 2011


Google can be your friend:


Using If...Then...Else Statement


       ' Dimension the variable.
       Dim x As Integer
       ' Place a value in x.
       x = Int(Rnd * 100)
       ' Display the value of x.
       MsgBox "The value of x is " & x & "."
       ' Test to see if x less than or equal to 10.
       If x <= 10 Then
          ' Display a message box.
          MsgBox "X is <=10"
       ' Test to see if x less than or equal to 40 and greater than 10.
       ElseIf x <= 40 And x > 10 Then
          MsgBox "X is <=40 and > 10"
       ' Test to see if x less than or equal to 70 and greater than 40.
       ElseIf x <= 70 And x > 40 Then
          MsgBox "X is <=70 and > 40"
       ' Test to see if x less than or equal to 100 and greater than 70.
       ElseIf x <= 100 And x > 70 Then
          MsgBox "X is <= 100 and > 70"
       ' If none of the above tests returned true.
       Else
          MsgBox "X does not fall within the range"
       End If






At 04:47 PM 20/10/2011, you wrote:
>The E-basic help doesn't say whether an if-then statement can have
>multiple conditions.  Seems limiting to not have that sort of
>functionality.
>
>-Nick
>
>On Oct 19, 11:15 pm, Peter Quain <pqu... at une.edu.au> wrote:
> > try searching e-basic help for "If...Then...Else (statement)". Note
> > the conditions under which you need to close the conditional with "End If"
> >
> > At 04:05 PM 20/10/2011, you wrote:
> >
> >
> >
> >
> >
> >
> >
> > >I'm having trouble with the below code.  E-Prime seems to want a
> > >'then' statement immediately following the 'if' statement:
> >
> > >if present.RESP = "z" and strHit2 = "aHi" or strHit2 = "aLo" strHit2 =
> > >"aMed" then
> > >                 Confidence.RESP = strHit2
> >
> > >If one response on the present slide is selected, I just want E-Prime
> > >to allow one of the three responses in the string hits.  How should
> > >this code look?
> >
> > >--
> > >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.
>
>--
>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.

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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listserv.linguistlist.org/pipermail/eprime/attachments/20111020/2d3888eb/attachment.htm>


More information about the Eprime mailing list