So I hv to use the lists component in the built-in blocks..?
And Do I have to add items to list first or call canvas.draw line first..?
Sure.The solution is to create a list of lists that will contain the x1,y1,x2,y2 values for drawline to allow an undo.Inside the Canvas Dragged event block place blocks to add the four values to a row in the list of lists.Each time the Dragged event is triggered, a four-value item is added to that list.The list builds until the user stops drawing.To undo, the user would press the undo button causing the last item of the list to be removed, screen to be cleared then the list iterated through and each set of values attached to a drawline block.The user can repeatedly press the undo button to remove more line segments until all have been removed, if desired.
---sf