Re: TIB: += function in TI Basic?


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

Re: TIB: += function in TI Basic?



The best and easiest way to do that i Ti-Basic is to use the 'For('
command.

the syntax is
For(variable,start,end,increment)

To accomlish what you want set 'start' to zero, call 'variable'
'total', and make 'increment' 'i'.
then use 'end' how you wish.



===


Avoid shortcuts.  They always take too much time in the long run.
--Unattributed


---Jim Fisher <killando@epix.net> wrote:
>
>  I'm currently writing a program for Chemistry to simplify doing
average
> atomic mass information.  Basically, I'm using a counter controlled
For loop
> based on a number the user inputs for the number of isotopes of an
element.
> In C/C++ I would keep track of a running total by:
> 
> total=total + i;
> 
> This can also be written as total+=i;
> 
> Or the like, where total and i are the variables, and total is
originally
> initialized to 0.
> 
> Is there a way to do something similar in TI Basic?  I seem to be
getting an
> error when I try that syntax...
> 
> -- Jim Fisher
> -- ICQ: 1332225
> -- http://echo.simplenet.com/humor
> -- http://echo.simplenet.com/wedge
> -- "We use words like honor, code, loyalty."
> 
> 
> 

_____________________________________________________________________
Sent by RocketMail. Get your free e-mail at http://www.rocketmail.com