Clearing Screen to Reflect New Drawing

i draw a line on screen then in next iteration of loop, i want to draw NEW line on previous-lines position. How to do it?

Regards

Basic pseudocode :

:start
draw line from a to b
b = a
a = new position
goto start

What is the problem ?