I forgot to mention; for a quick test (experiment), I put all the code in Form.Init(). Of course, you will have to decide eventually when you want to execute the code, for example, in a Button.KeyPress(), or with a Timer.
Here is another example, with a Timer, which will draw the sine curve slowly.
Create form properties .x = 0, .y = 0, .i = 0, and place the following code into the Timer.Timer Event:
with ThisForm
.i = .i + 0.05
.x = .i*100
.y = sin(.i)*100 + 100
.Line(.x, .y)
if .i >= 2*pi()
This.Enabled = .F.
endif
endwith
I know, it is not perfect; this is just a quick sample. I'll leave the details to you.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)