1. ROBERT CRAIG
- Posted by Bernie Ryan <bwryan at PCOM.NET> Feb 28, 1999
- 446 views
-- Attention Robert: -- I am using Euphoria ver 2.0 -- I am having a problem with compiling a if/elsif/else -- Please explain to me what I am doing wrong integer a, b, c, d a = 1 b = 2 c = 3 d = 4 ----------------- this will compile OK if a = 1 then ? d end if if a = 2 then ? d end if if a = 3 then ? d end if ----------------- If you try to compile this ----------------- compiler will report an error ----------------- but this should be ok -- if a = 1 then -- ? d -- elsif a = 2 then -- ? d -- else a = 3 then -- <<----- this fails -- ? d -- end if ----------------- by changing the else to elsif ----------------- compiler will not report an error ----------------- but I am not sure this compiles to the same thing if a = 1 then ? d elsif a = 2 then ? d elsif a = 3 then -- <<----- changed else to elsif ? d end if --------------- Thank You for your time Bernie
2. Re: ROBERT CRAIG
- Posted by Jiri Babor <J.Babor at GNS.CRI.NZ> Mar 01, 1999
- 431 views
Bernie, There is no such thing as 'else ... then' clause. Your line is interpreted as a simple assignment 'a = 3' followed by 'then' WITHOUT matching 'if' or 'elsif'. jiri
3. Re: ROBERT CRAIG
- Posted by Bernie Ryan <bwryan at PCOM.NET> Feb 28, 1999
- 435 views
DAAAAAA !!!! My brain is geting too old, my eyes are too weak and my tongue keeps getting caught in my eye tooth and I can't see what I am saying. Thanks Bernie