Hello,
I'll do my best to explain my problem.
I have a list with several lines, "listLines."
In another list, I have the indexes of the lines to delete from the "listLines" list, but when I loop through it, it doesn't work.
Thanks in advance for your help.
Here's the project.
It's on the "LesPlans" screen.
In short, I'm trying to create a sort of plan with lines in a canvas. And when you click on the trash can and press the "valider" button, it deletes the lines that have the coordinates of the "trash can" sprite.
This code sequence will lead to grief.
Your 4 elements are numbers, and JOINing them will result in a nonunique string of digits.
If you want a text representation of a 4 number list for a ListView Element, use the
JOIN With Separator ',' block, to turn a list into a comma delimited string.
Reverse that with the Split at ',' block to recover the 4 item list of coordinates.
If you use this text representation of each line as a key in a dictionary, with value TRUE for the existence of that line in a plan, you can represent each plan as a dictionary, with the keys of that dictionary all ready formatted as ListView Elements.
Deletion of a line from such a dictionary would then be just removing that key/value from the dictionary.
This approach avoids getting tangled up with list indexes, since it works entirely by value.
Hello,
I understand what you mean, but how can I get around this problem?
What I'm trying to do is, when the sprite retrieves the coordinates where it is located, it should check if there are any coordinates that are exactly the same, and if so, it should delete them from the list.
Sorry, but I'm just starting out and I'm going through the "trial and error" process.