Menu

What's wrong with this code?

Help
Tice
2010-03-20
2013-04-11
  • Tice

    Tice - 2010-03-20

    Please help, what could be wrong with the following code?
    It is intentionally endless loop, I just would like to display the current time in M0 and M1 (by monitor/mem 2).
    Instead, it starts drawing random lines in graph mode.

    Thanks in advance,
    Tice

    prog/flow/LBL 0
    conv/time/now
    100
    /
    ENTER
    int/trunc
    mem/STO 0
    -
    1000000
    *
    int/round
    mem/STO 1
    clear
    prog/flow/GTO 0

     
  • Roar Lauritzsen

    Roar Lauritzsen - 2010-03-22

    That program is an infinite loop. If a program takes too long to finish, you will get a "screen saver" of random lines just to indicate that it is still doing something. However, your program will never end, since when it reaches the end it will start over again by the "GTO 0" command. Just remove "GTO 0" and you will be fine.

     
  • Tice

    Tice - 2010-03-25

    Thank you, Roarl!

    I understand, but as I wrote, it is intentionally infinite loop: my aim was to show the current time continuously.
    Is there any way to achieve this?

    Regards, Tice

     
  • Roar Lauritzsen

    Roar Lauritzsen - 2010-03-25

    An interesting notion, but no, it doesn't work like that. While the program is running, the calculator is busy and unresponsive.

     
  • Tice

    Tice - 2010-03-25

    OK, I see…
    Anyway, it's not a programming platform, just a calculator (happens to be programmable). :-)

     

Log in to post a comment.