Re: 82 Prob.


[Prev][Next][Index][Thread]

Re: 82 Prob.



Well, first of all, you need an end to complete the if-then-else-end group.
Second of all, I don't see why you can't solve this?  Read on...

original message:
>Hi all,
>I am having some trouble eliminating some goto's in a
>program that I've been editing.  The prog. is supposed to
>factor a number that you give.  Here's the problem:
>....
>If T>10
>Then
>35+Y /sto/ Y : 0 /sto/ T : 0 /sto/ X
>goto 0
>Else
>goto 0
>lbl 0
>.....
>
>Now I know that goto's are VERY BAD because they fill up the
>calcs memory quickly, but I can't find a way to get around
>this one.  Any help would be appreciated.  Thanx!
>-David

okay, now look at the program:

>If T>10
>Then
>35+Y /sto/ Y : 0 /sto/ T : 0 /sto/ X
>goto 0
>Else
>goto 0
>lbl 0

ummm...there's a goto in both the if-then and the else.
change it to:

If T>10
Then
35+Y /sto/ Y : 0 /sto/ T : 0 /sto/ X
End
lbl 0

...because no mater what you will be going to 0
and if lbl 0 isn't important anywhere else...

If T>10
Then
35+Y /sto/ Y : 0 /sto/ T : 0 /sto/ X
End

hmmmm...I hope I answered your question, because I thought it was pretty
obvious...but then again maybe you've just started out programming, so don't
feel bad.

~ADAMMAN106