A class is a named set of related data and the functionality that works on that data. A class must be part of a namespace, even if the namespace is not specifically declared within the source code.

If you are using classes that are not system‑supplied (i.e., that were not provided by Synergex) and you rebuild any object module using a class, you must rebuild all object modules using that class.

Creating a class

The following steps are general instructions for creating a class. Note that most of these steps are optional, since a class can consist solely of data or routines, or nothing at all.

1. Add a class declaration within a namespace declaration using the CLASS statement. (See CLASS‑ENDCLASS.) If you want the class to inherit functionality from an existing class, see Inheriting class functionality and data.
2. (optional) Add fields within the class declaration.
3. (optional) Add one or more methods within the class.
4. (optional) Add constructors and a destructor.
5. (optional) Add properties to the class.
6. (optional) Nest other class declarations inside the class.
7. Save the source file containing the class declaration.
8. (traditional Synergy only) Compile the source file into a .dbo file.
9. (traditional Synergy only) If the class is not defined in the main program file, run the Synergy Prototype utility (dblproto) against the source file to export the new class definition.