...
With canvas
.Scissor=New Recti( sx,sy,sx+sw,sy+sh )
.Clear( New Color( 1,32.0/255.0,0,1 ) )
.PushMatrix()
.Translate( tx,ty )
.Scale( Width/640.0,Height/480.0 )
.Translate( 320,240 )
.Rotate( Millisecs()*.0003 )
.Translate( -320,-240 )
End WIth
The above is a fairly trivial example to simply avoid some typing but it can be oh so much more powerful :
With SlowComplexFunctionToLookupAnObject()
.DoThing()
.DoOtherThing()
... do lots of things with the object you looked up, without having to create a local variable to hold it
End With
Or :
With New ThingThatNeedsComplexInitialisation()
.BuildFoundations()
.AddRoom("Home", 2, 2)
.AddDoor(2,2,2,3)
.AddCorridor(5,5,5)
...build whole house, or whatever
End With
Original Author: arpie42
Like in Pascal, or Javascript, or D...
Code like this seems so unnecessarily verbose :
Isn't this so much cleaner :
The above is a fairly trivial example to simply avoid some typing but it can be oh so much more powerful :
Or :