PointShop Clamp

So I am trying to clamp the points to the screen like in the corner, can anyone help me out a bit?

[lua]local x, y = math.Clamp( x, 0, ScrW() ), math.Clamp( y, 0, ScrH() )[/lua]