A class in RedCrab is a collection of variables and functions that describe or calculate the properties of an object. A class can replace hundreds of individual functions

Syntax

Object = Class("Argument name", Argument)

Description

The following example uses the class circle

The circle has four properties; Radius r, diameter d, circumference A and the area P

The object c is used as the "container" of the properties

The object is initialized by calling Circle; the arguments "r" and 10 are the parameters. "r" denotes the property (radius), which is defined as given, 10 is the value of the radius

All other properties are calculated automatically

The Circle properties can be used in other calculations qualified by their name, separated by a dot

Example

Description

The Circle class replaces 12 individual functions, which would be necessary to realize all possible calculations of a circle. ( d from r, A from r, P from r, P from A, d from P etc.)

The class Cylinder contains 28 properties. To calculate all variants, several hundred functions would have to be installed

The 17 geometry classes replace thousands of individual functions

Example

If multiple parameters are passed, they are separated by commas

If you need only a single property, alternatively you can write: