Re: Bugs (my program, not yours)

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

>clear_screen
>kb = open("CON","r")
>puts(1,"Do you want hard copy? - y/n\n")
>hcopy = getc(kb)
>        [snip]
>puts(1,"Specify  output... ")
>outspec = getc(kb)
>        [snip]
>puts(1,"Number to be analyzed\n")
>puts(1,"Enter 0 to end program\n")
>x = gets(kb)
>if x = 0 then
>        abort(0)
>end if
>        [snip]

I think the erros you described are from the kb = open("CON","r") line.
Try something more like this:

clear_screen()
puts(1,"Do you want hard copy? - y/n\n")
hcopy = wait_key()      -- getc() isn't too reliable in my experience

----

puts(1,"Specify  output... ")
outspec = wait_key()

----

puts(1,"Number to be analyzed\n")
puts(1,"Enter 0 to end program\n")

x = get(0)                  -- Accept numeric input from STDIN
                            -- (the keyboard unless redirected)
if x[1] = GET_SUCCESS then
    if x[2] = 0 then
        abort(0)
    end if
end if


_____________________________________________________________________
You don't need to buy Internet access to use free Internet e-mail.
Get completely free e-mail from Juno at http://www.juno.com
Or call Juno at (800) 654-JUNO [654-5866]

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

Search



Quick Links

User menu

Not signed in.

Misc Menu