Re: Why doesn't this work?
- Posted by Brett Pantalone <EUSBAPA at AM1.ERICSSON.SE> May 28, 1998
- 791 views
Hi Alan, I am new to Euphoria myself, but I think I can see two problems with your code fragment. First, Euphoria automagically declares loop variables, so your statement "atom prompt_loop" is redundant and causes the redeclaration error. Second, the correct syntax for the "for" statement is "for var = x to y do". You left out the "do" keyword. Hope this helps! Brett Pantalone, Ericsson Inc. Research Triangle Park, NC, USA MailTo:Brett.Pantalone at ericsson.com > -----Original Message----- > From: Alan Tu [SMTP:ATU5713 at COMPUSERVE.COM] > Sent: Wednesday, May 27, 1998 7:03 PM > To: EUPHORIA at cwisserver1.mcs.muohio.edu > Subject: Why doesn't this work? > > I am trying to improve a program that prompts for values for a, b, > c...l. > I tried to use the input function, but that didn't work. So I > returned to > the basics. This is what I have. > > clear_screen() > sequence prompt > atom prompt_loop > prompt = {97,98,99,100,101,102,103,104,105,106,107,108} > for prompt_loop = 1 to 12 > print(1,prompt[prompt_loop]) > end for > abort > > it should print abcdefghijkl. No, that's wrong. It should print > 979899100101102103104... but its not even doing that. It says I'm > redefining something. My logic seems OK. What's wrong? > > --Alan >