1. Or What?
- Posted by Paul Kerslake <paulk at UNISERVE.COM> Nov 17, 2000
- 420 views
- Last edited Nov 18, 2000
------=_NextPart_000_000B_01C050CE.289C7080 charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hello, I've been wrting a program that needs to check a few instances before = executing an if statement. Like so: if X=3D1 (somecommand) Y=3D2 then puts(1,"X=3D1 and Y=3D2") end if Can I use or for this? Is it as literal as it sounds? Like if this = variable or this variable equals this, then do the following.(?) -Thanks -Thomas ------=_NextPart_000_000B_01C050CE.289C7080 charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD> <META content=3D"text/html; charset=3Diso-8859-1" = http-equiv=3DContent-Type> <META content=3D"MSHTML 5.00.2614.3500" name=3DGENERATOR> <STYLE></STYLE> </HEAD> <BODY bgColor=3D#ffffff> <DIV><FONT face=3DArial size=3D2>Hello,</FONT></DIV> <DIV> </DIV> <DIV><FONT face=3DArial size=3D2>I've been wrting a program that needs = to check a=20 few instances before executing an if statement. Like so:</FONT></DIV> <DIV> </DIV> <DIV><FONT face=3DArial size=3D2>if X=3D1 (somecommand) Y=3D2 = then</FONT></DIV> <DIV><FONT face=3DArial size=3D2>puts(1,"X=3D1 and Y=3D2")</FONT></DIV> <DIV><FONT face=3DArial size=3D2>end if</FONT></DIV> <DIV> </DIV> <DIV><FONT face=3DArial size=3D2>Can I use <EM>or</EM> for this? Is it = as literal as=20 it sounds? Like if this variable or this variable equals this, then do = the=20 following.(?)</FONT></DIV> <DIV> </DIV> <DIV><FONT face=3DArial size=3D2>-Thanks</FONT></DIV> <DIV><FONT face=3DArial size=3D2>-Thomas</FONT></DIV> <DIV> </DIV> ------=_NextPart_000_000B_01C050CE.289C7080--
2. Re: Or What?
- Posted by Euman <euman at BELLSOUTH.NET> Nov 17, 2000
- 415 views
- Last edited Nov 18, 2000
------=_NextPart_000_0008_01C050EC.FEE50620 charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi Paul "and" will evaluate both to make sure x=3D1 and y=3D2 "or" will evaluate both as well, but only one x or y=20 needs to be true to =3D to "puts" besides, I believe you answered your own question in "puts" didnt you? ----- Original Message -----=20 From: Paul Kerslake=20 To: EUPHORIA at LISTSERV.MUOHIO.EDU=20 Sent: Friday, November 17, 2000 10:39 PM Subject: Or What? Hello, I've been wrting a program that needs to check a few instances before = executing an if statement. Like so: if X=3D1 (somecommand) Y=3D2 then puts(1,"X=3D1 and Y=3D2") end if Can I use or for this? Is it as literal as it sounds? Like if this = variable or this variable equals this, then do the following.(?) -Thanks -Thomas ------=_NextPart_000_0008_01C050EC.FEE50620 charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD> <META http-equiv=3DContent-Type content=3D"text/html; = charset=3Diso-8859-1"> <META content=3D"MSHTML 5.50.4522.1800" name=3DGENERATOR> <STYLE></STYLE> </HEAD> <BODY bgColor=3D#ffffff> <DIV><FONT face=3DArial size=3D2>Hi Paul</FONT></DIV> <DIV><FONT face=3DArial size=3D2></FONT> </DIV> <DIV><FONT face=3DArial size=3D2>"and" will evaluate both to make sure = x=3D1 and=20 y=3D2</FONT></DIV> <DIV><FONT face=3DArial size=3D2>"or" will evaluate both as well, but = only one x or=20 y </FONT></DIV> <DIV><FONT face=3DArial size=3D2> needs to = be true to=20 =3D to "puts"</FONT></DIV> <DIV><FONT face=3DArial size=3D2></FONT> </DIV> <DIV><FONT face=3DArial size=3D2>besides, I believe you answered your = own=20 question</FONT></DIV> <DIV><FONT face=3DArial size=3D2>in "puts" didnt you?</FONT></DIV> <DIV><FONT face=3DArial size=3D2></FONT> </DIV> <BLOCKQUOTE dir=3Dltr=20 style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; = BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px"> <DIV style=3D"FONT: 10pt arial">----- Original Message ----- </DIV> <DIV=20 style=3D"BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: = black"><B>From:</B>=20 <A title=3Dpaulk at UNISERVE.COM href=3D"mailto:paulk at UNISERVE.COM">Paul = Kerslake</A>=20 </DIV> <DIV style=3D"FONT: 10pt arial"><B>To:</B> <A = title=3DEUPHORIA at LISTSERV.MUOHIO.EDU=20 = </A>=20 </DIV> <DIV style=3D"FONT: 10pt arial"><B>Sent:</B> Friday, November 17, 2000 = 10:39=20 PM</DIV> <DIV style=3D"FONT: 10pt arial"><B>Subject:</B> Or What?</DIV> <DIV><BR></DIV> <DIV><FONT face=3DArial size=3D2>Hello,</FONT></DIV> <DIV> </DIV> <DIV><FONT face=3DArial size=3D2>I've been wrting a program that needs = to check a=20 few instances before executing an if statement. Like so:</FONT></DIV> <DIV> </DIV> <DIV><FONT face=3DArial size=3D2>if X=3D1 (somecommand) Y=3D2 = then</FONT></DIV> <DIV><FONT face=3DArial size=3D2>puts(1,"X=3D1 and = Y=3D2")</FONT></DIV> <DIV><FONT face=3DArial size=3D2>end if</FONT></DIV> <DIV> </DIV> <DIV><FONT face=3DArial size=3D2>Can I use <EM>or</EM> for this? Is it = as literal=20 as it sounds? Like if this variable or this variable equals this, then = do the=20 following.(?)</FONT></DIV> <DIV> </DIV> <DIV><FONT face=3DArial size=3D2>-Thanks</FONT></DIV> <DIV><FONT face=3DArial size=3D2>-Thomas</FONT></DIV> <DIV> </DIV> ------=_NextPart_000_0008_01C050EC.FEE50620--
3. Re: Or What?
- Posted by jiri babor <jbabor at PARADISE.NET.NZ> Nov 19, 2000
- 402 views
Kat wrote: > Just my two cents worth, use "(" and ")" around all evaluations, it > could save you a headache later when you run into presidences of > evaluation. Kat, I think this one is hardly worth two cents ;). Firstly, you did not bother with the spelling checker, and secondly, I would not worry about the parentheses, unless it is really a very complex expression. You see, euphoria is one of very few languages with infix notation that got the operator precedence right. jiri
4. Re: Or What?
- Posted by Kat <gertie at PELL.NET> Nov 18, 2000
- 404 views
Just my two cents worth, use "(" and ")" around all evaluations, it could save you a headache later when you run into presidences of evaluation. if ( X = 1 ) and ( Y = 2 ) then Kat On 17 Nov 2000, at 23:20, Euman wrote: > Hi Paul > > "and" will evaluate both to make sure x=1 and y=2 > "or" will evaluate both as well, but only one x or y > needs to be true to = to "puts" > > besides, I believe you answered your own question > in "puts" didnt you? > > ----- Original Message ----- > From: Paul Kerslake > To: EUPHORIA at LISTSERV.MUOHIO.EDU > Sent: Friday, November 17, 2000 10:39 PM > Subject: Or What? > > > Hello, > > I've been wrting a program that needs to check a few instances before > executing an if statement. Like so: > > if X=1 (somecommand) Y=2 then > puts(1,"X=1 and Y=2") > end if > > Can I use or for this? Is it as literal as it sounds? Like if this variable > or this variable equals this, then do the following.(?) > > -Thanks > -Thomas > > >