Re: Nested If Statements


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

Re: Nested If Statements



The only limit to the number of nested loops is available memory, meaning,
essentially, you will only encounter it if you have a looping error in your
program. You can nest any type of loop within another. Whenever an End
statement is executed, it refers to the last loop that was begun. Unless the
programmer makes a mistake in the program structure, the calculator will not
get confused. When programs are larger than 20-30 lines are so, I write them
with the Windows Graph-Link software and then transfer them with the cable, so
it's easier to see more of the program.
________________

Jeff Tyrrill's TI Calculator Site: Contains programming tips, undocumented
discoveries and tips for power users, and comparisons of the different
calculator models.
http://tyrrill-ticalc.home.ml.org/

TI-Files member: The premiere TI site on the web, with reviews of games and
more.
http://ti-files.home.ml.org/


-----Original Message-----
From:   Open discussion of TI Graphing Calculators  On Behalf Of Christopher
Myers
Sent:   Monday, June 23, 1997 7:01 AM
To:     CALC-TI@LISTS.PPP.TI.COM
Subject:        Nested If Statements

I'm working on a program on a TI-82 and it must contain multiple nestings of
If-Then-Else statements.  My manual for the calc mentions that nesting single
If statements is OK, but no mention is made for nesting If-Then or
If-Then-Else.  Is there a limit to the number of levels I may nest to?
Looking
at the program as it is formatted in the machine is confusing, too, since it's
hard to tell which End corresponds to which Then or Else.  I'm a C++
programmer, so I'd really like to use indentation and brackets, but obviously
I
can't.  I think my calc is getting confused about which End goes with which
Then or Else.

Has anyone out there had similar problems or have any hints or suggestions?
 BTW, I'd like to avoid using Lbl and Goto - many years of programming classes
have drilled into my head that that is "bad style", but I guess if that's my
only option, I'll have to use it.

Thanks, Folks!

-Chris

--
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*

                                  Christopher Myers
                          Hibbitt, Karlsson & Sorensen, Inc.
                          1080 Main St. Pawtucket, RI  02860
                             tel:  (401)727-4200 X 4404
                             fax:  (401)727-4208
                             email:  myers@hks.com

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*