If then and loops

Peter Quain pquain at une.edu.au
Thu Oct 20 06:01:59 UTC 2011


Note in description: "statement or group of statements."

-----------------------
Syntax 1

If condition Then statements [Else else_statements]

Syntax 2

If condition Then
         [statements]
[ElseIf else_condition Then
         [elseif_statements]]
[Else
         [else_statements]]
End If
-------------------------
Description

Conditionally executes a statement or group of statements.

Comments

The single-line conditional statement (syntax 1) has the following parameters:

Parameter       Description

condition       Any expression evaluating to a Boolean value.
statements      One or more statements separated with colons. This 
group of statements is executed when condition is True.
else_statements One or more statements separated with colons. This 
group of statements is executed when condition is False.


The multiline conditional statement (syntax 2) has the following parameters:

Parameter       Description

condition       Any expression evaluating to a Boolean value.
statements      One or more statements to be executed when condition is True.
else_condition  Any expression evaluating to a Boolean value. The 
else_condition is evaluated if condition is False.
elseif_statements       One or more statements to be executed when 
condition is False and else_condition is True.
else_statments  One or more statements to be executed when both 
condition and else_condition are False.

-------------------------------

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.



More information about the Eprime mailing list