Hi and welcome.
As you can see, there are often many solutions for one problem. As a programer its up to you, to find the one, that fits best to your needs. My solution for your Problem would be GRABSPRITE:
REPEAT
DRAWSPRITE 1, 0,0
DRAWRECT RND(800), RND(600), RND(100), RND(100), RGB(RND(255), RND(255), RND(255))
GRABSPRITE 1, 0,0, 800,800
SHOWSCREEN
UNTIL KEY(28)
MOUSEWAIT
END