Re: TIB: List-Q


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

Re: TIB: List-Q




>On the 83 it's like this. Say you have ten possible items, so you'd
>make the list with eight elements.
>:8->dim(L1
>:Fill(0,L1
>You now have a L1 that looks like this
>{0,0,0,0,0,0,0,0}


Just so you know (FYI): /->/ is store     /<>/  is not equal to    /@/ is
theta

On the 85, I think you would just say
:8/->/ dim LIST      LIST can be anything up to 8 characters and must start
with a letter I i think

But I would make it
:1/->/dim LIST

then when you buy something you say
:dim LIST +1/->/dim LIST     make the list one longer
:NUMBER/->/LIST(dim LIST-1)     this will store a NUMBER into the list at
one place from the end.

then when you want to display, you display all but the last one.
:If dim LIST > 1
:Then
:For(COUNT,1,(dim LIST)-1)
:Disp LIST(COUNT)
:End
:Else
:Disp "You have nothing stored."
:End


Or

:If dim LIST > 1
:Then
:For(COUNT1,0,(dim LIST)-1,8)
:For(COUNT2,1,(dim LIST)-1)
:Disp LIST(COUNT1+COUNT2)
:End
:Pause
:End
:Else
:Disp "You have nothing stored."
:End

The only difference is that the second will stop after each 8 and wait for
the user to push enter.  this will allow you to store up to 998 items.


>One thing that is kind of important, I think, is the way it checks the
>money. Notice that the check to see if the balance is positive or
>negative is done BEFORE the amount of money is changed. One might be
>tempted to do this (I'm assuming that the total cost of the item is 5)
>:U-5->U
>:If U >= 0
>:Then
>:......
>:Else
>:Disp "YOU CAN'T AFFORD THAT
>:End
>
>The problem with this is, the money is subtracted regardless of
>whether or not the person has enough money. This will make a big
>difference if there is the possibility to get OUT OF debt. Think about
>it. Say the person's balance is -5 and they try to buy something that
>costs 5. Obviously they can't, and the calc will say that they can't.
>However U, the variable that represents that person's money, will go
>down ANOTHER five. Now their balance will be -10, even though they
>didn't actually buy anything. Just something you might want to be
>careful about.



We already fixed that problem.


>
>Jody Snider
>jody1@alaska.net
>


Follow-Ups: