Re: Why doesn't this work?

new topic     » goto parent     » topic index » view thread      » older message » newer message

Alan Tu wrote:

> 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

Okay, I see what's wrong. pull out the "atom prompt_loop" and put a do after
the for line.

clear_screen()
  sequence prompt

      prompt = {97,98,99,100,101,102,103,104,105,106,107,108}
        for a_loop = 1 to 12 do
          print(1, prompt[a_loop])
            end for

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu