Food filling a rectangular area

fill rectangle

Flood fill a rectangular area


SYNTAX

fill rectangle width = width height = height [brush = text_expression] [pen = pen_no] [in window_id]

Flood fills a rectangular area on the screen, with the top-left hand corner positioned at the window’s current logical cursor position. The cursor is positioned by means of the move cursor to | at command. The clauses may appear in any order.

width = width
height = height

These values must both be supplied. The width is specified in columns and the height in rows. Both width and height may be any type of expression that produces an integer value. Whatever the size of the rectangle, it is truncated at the edge of the window in which it is being displayed, within the border (if any).

[brush = text_expression]

If present, this clause specifies the character or characters with which to fill the rectangle. If absent, the default fill character, a space (” “) is used.

[pen = pen_no]

If this clause is present, the specified pen from the window paletteis used to draw the line. Otherwise the default pen PEN_LINE_GRAPHIC (34) is used.

[in window_id]

If the in window_id clause is present the fill operation is performed in the window specified. The window need not be open.

If the in window_id clause is absent, the window that was the subject of the last move cursor to | at command is selected. If no move cursor to | at command has yet been executed in the program, then the task window is used.

It is recommended that the window_id always be specified.


Flood filling

Flood filling an area does not destroy everything within it.

Destroyed by flood filling

Destroyed by flood filling

1

Data written to the screen with the put command

2

Graphics created with draw commands. See draw hline|vline, draw rectangle.


Not destroyed by flood filling

1

Window objects

2

Window object labels


EXAMPLES

A small rectangle filled with the default brush, the space character

fill rectangle width = 5 height = 3 in MyWindow

A rectangle filled with the letters “TK”

fill rectangle width = 10 height = 15 brush = "TK" in Window2

A rectangle filled with dollar signs

fill rectangle width = 60 height = 20 brush = "$" pen = 21


RELATED TOPICS

draw rectangle

move cursor to | at