With Statements

A With statement is a way of modifying the graphics context for a group of statements within a Shape routine.

withstmt ::= With grcontextlist Do stmtblock EndWith ;

The grcontextlist is a list of expressions, each of which yields a result having the type of one of the graphics context objects. Not all the graphic context items need to be specified and no type may occur more than one. Any context not specified will contain the value inherited from the surrounding block. The way the context operates is the same a for the graphics context for a draw statement.

The stmtblock is a standard list of statements with an optional OnError section.

With {100, 100}, Pen { colour -> {100, 0, 0} } Do
	Circle(50);
	Line({-10, 0}, {10, 0});
EndWith;