Different output with the same input

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

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

Attached are the 2 procefures 'sortedMillisList' and 'millusDatetime'.


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.

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!