PlayBasic Tutorial: Into to IF / Then and IF / ENDIF statements ( 2017/03/21)
This #tutorial walks the new coder through the IF / THEN and IF / ENDIF statement pairs which are used to selectively execute sections of the code, based upon the result of the comparison operators. IF statements actually allow changes in execution control, so they act upon the comparison, but it's just easier to think of them as part of the comparisons landscape when learning programming.
Setfps20DoClsrgb(20,30,40);
Mx =MouseX()
My =MouseY()Circle Mx,My,40,trueprint Mx
print My
box500,300,600,400,falseif(Mx >500)and(Mx <600)and My >300and My<400print"Mouse is within zone"endifSyncloop