TnJT
December 19, 2025, 12:58am
1
I'm having a strange issue with a program I'm working on.
When I call a procedure 'millsDatetime' the output of the procedure is a list of length 2. But when I included another procedue ''sortedMillisList' after the procedure 'millisDatetime' , the output becomes an empty list. Why is it
so? Please see the code blocks attached.
Nope, it depends upon the two more procedures. Irrespective of the input Thats why it gives you the error
Share us that two more procedures blocks too
Taifun
December 19, 2025, 1:55am
3
There must be another issue because you do not modify millisDatetime inside that procedure
Btw to sort a list what about just using the make new sorted list from block?
http://ai2.appinventor.mit.edu/reference/blocks/lists.html#sort
Taifun
TnJT
December 19, 2025, 3:13am
4
Attached are the 2 procefures 'sortedMillisList' and 'millusDatetime'.
ABG
December 19, 2025, 4:00am
5
When you set a list equal to another list in AI2, you are pointing it at the contents of the other list.
So when you remove items from that list, you are actually removing them from the other list.
Use the copy list block to avoid that.
Or better yet, use the advanced list blocks if you don't want to reinvent the wheel.
TnJT
December 19, 2025, 4:22am
6
Thank you ABG and all.
The copy list block works correctly for me.
I've been trying to debug for many days and now it is solved.
Thank you very much!