2017년 3월 7일 화요일

Replace items between two lists after calculate the items each other list.


How to replace the items in lists after calculating each items between two lists.
Error:   (on screen)
List index smaller than 1
Replace list item: Attempt to replace item number 0 of the list (5 3 5). The minimum valid item number is 1.
*
In the replace list item part, I did make sure I will grab the position that I need to change the item's value and the (after calculating ) items that I will use them to replace the previous items.
Thus, I used the variables as the registers called "gain_for_index", "pay_for_index", "gain_for_register","pay_for_register"
I am stuck with this problem(List index smaller than 1) for few weeks, the only thing I noticed from the error message is that something wrong with "replace list item". That's the reason why I used the register to 
make sure I can grab the previous item to match the previous list index then replace the item in the "position (index)" I am desire to replace.    
Hope somebody can help me out this problem. I will appreciate it!
For example:
There are two lists as followed:    ( 3 items in each list )
===========================================
Gain List :  ( -3  -4  -6 )
Pay List :  ( 5  3  5)                   
===========================================
Then I need to calculate the items each other (between two lists) with order and replace the value in the original position (index).
The items (value) in two lists will finally be 0.
nd I will display some text on my screen between every round.
We don’t calculate the item which value is 0.
My logic part:









--
This is my "aia" file.

댓글 없음:

댓글 쓰기