# Shape Array Specification

Version 19

Nonki Takahashi

## Purpose

This specification defines the shape array in Microsoft Small Basic programming language. The typical application of the shape array is the

Shapes editor.

## Definitions

This specification defines the data format of the shapes array and subroutines to manipulate the array.

### Data Format

**The Array**
The name of the array is

**shape**.

**Indices**
In the shape array, following indices are used.

**func** - functions such as **rect** (rectangle), **ell** (ellipse),
**tri** (isosceles triangle), **line**, **img** (image), and **text**.
**x** - the x co-ordinate on the left of the shape. **y** - the y co-ordinate on the top of the shape. **width** - width for rectangle, ellipse and image. **height** - height for rectangle, ellipse and image. **bc** - the color of the brush such as #FFFF00. **pc** - the color of the pen such as #000000. **x1** - the x co-ordinate for the first point a line or for the vertex point of an isosceles triangle.
**y1** - the y co-ordinate for the first point a line or for the vertex point of an isosceles triangle.
**x2** - the x co-ordinate for the second point a line or for the left base point of an isosceles triangle.
**y2** - the y co-ordinate for the second point a line or for the left base point of an isosceles triangle.
**x3** - the x co-ordinate for the right base point of an isosceles triangle.
**y3** - the y co-ordinate for the right base point of an isosceles triangle.
**fn** - the font name for a text. **fs** - the font size for a text. **fb** - "TRUE" if font bold for a text. **fi** - "TRUE" if font italic for a text. **name** - the name of the shape.

### Virtual Functions (Read Only)

These functions are read only and converted other functions above.

**func** - **trap** (trapezoid) and **hex** (hexagon). **ratio** - relative x position per height for the top left vertex.

### Subroutines

**Shapes_Init** - initializes the shape array and the offset **shX** and
**shY**. **Shapes_Add** - adds the shapes indicated with indices between **iMin** and
**iMax**. **Shapes_Convert** - converts virtual functions to functions between **iMin** and
**iMax**. Then returns new **iMax**. **Shapes_Flip** - flips the shapes horizontally with indices between **iMin** and
**iMax**. **Shapes_Move** - moves the shapes indicated with indices between **iMin** and
**iMax** to (**x**, **y**). **Shapes_Rotate** - rotates the shapes indicated with indices between **iMin** and
**iMax** by **angle**.