Re: basic question


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

Re: basic question



The problem is that "If", when used alone (i.e. If X=1:Goto AB), only reads
the following line. What you want to use instead is If-Then-End. For
example:

If X=1
Then
X+1->X
Goto AB
End

In your case, just change "If E=1:ClrHome:Goto 2" to "If
E=1:Then:ClrHome:Goto 2:End". Also, you don't need an "End" at the end of
the program; the "End" command is just for ending "If-Then"s, "For"s, and
"Repeat"s. To end the program, use "Stop".

Remember, you do not need an End after an If command, but you DO need an End
after an If-Then command. The syntax for If is:

If [condition]
[what to do if condition is true -- on one line only]

The syntax for If-Then is:

If [condition]
Then
[what to do if condition is true]
[what else to do if condition is true]
[what else to do if condition is true, etc.]
End

The syntax for If-Then-Else is:

If [condition]
Then
[what to do if condition is true -- on as many lines as you like]
Else
[what to do if condition is UNTRUE -- on as many lines as you like]
End


Hope this helps.



Marc Macauley
op132 AT home DOT com


Jrsand0427 <jrsand0427@aol.com> wrote in message
19990421232025.00297.00000306@ng29.aol.com">news:19990421232025.00297.00000306@ng29.aol.com...
> i made this program for my ti83 to help me with my homework.  i made it
kinda
> long for a short program.  the problem i have is that at the end of the
program
> i have an input and when i put in 1 or 2 i go to the same place every time
and
> not two different places.  here is the program:
>
> Lbl 1
> ClrHome
> Prompt A,B
> Lbl 2
> Prompt X,Y
> AX+BY -> C
> Disp C,""
> Input"1: NEW   2: STOP",D
> If D=1:Goto 4
> If D=2:Goto 3
> End
> Lbl 3
> ClrHome
> Stop
> Lbl 4
> ClrHome
> Disp "  SAME A and B"
> Input "1: YES     2: NO",E
> If E=1:ClrHome:Goto 2
> If E=2:Goto 1
> End
>
> that last part where it says Disp "  SAME A and B"
>                                         Input "1: YES     2: NO",E
>                                         If E=1:ClrHome:Goto 2
>                                         If E=2:Goto 1
>
> that's where my problem is.  if i press 1 all goes well.  but if i press 2
it
> comes up with the x and y prompt w/o clearing the home screen.  if someone
> could help me with this it would be greatly appreciated.  sorry about how
long
> this is.  thanx.
>
> ---
>
> Newspaper Headline:
> One-legged transvestite accused
> of theft, fraud.
>
> life is not a dress rehearsal.
> get it right the first time but live it to the fullest.
>
> the one-legged lepper has spoken.
>
> -john-

******************************************************************
* To UNSUBSCRIBE, send an email TO: listserv@lists.ppp.ti.com
* with a message (not the subject) that reads SIGNOFF CALC-TI
*
* Archives at http://peach.ease.lsoft.com/archives/calc-ti.html
******************************************************************


References: