Object Statement

Defines a singleton object.

Syntax

[ @Shared ] Object #name [ Is class_name ] [ Does trait_name ]…
    [ statements ]
End [ Object ]

Parts

@Shared
Optional modifier specifies that the object can have a small scope, but its lifetime continues until the program completes.
#name
Mandatory name for the object.
class_name
Optional name of a class from which the object inherits methods and properties.
Does
Optional keyword that you can use again and again.
trait_name
Mandatory after Does. See Does Clause (Traits) for more information.
statements
Optional declarations and executable statements.
End
Completes the statement. You can also use End Object
You can change this part of the syntax. See @Option Directive for more information.

Instructions

Object operates almost the same as Class and New put together. The result is an object called a singleton. The object is the only instance of its class, and you cannot make a copy of it.

You define an object almost the same as a class. It is divided into two parts – data and code.

All members of an object are shared. Thus it is not necessary to declare a member with @Shared.

Permitted members

You can define most of the same members in Object that you can in Class. But you cannot use Constructor and Destructor. A list of permitted members follows.

Examples

TODO

See also