Skip to content

Objects

OneScript supports the idea of modular development and reusable code. In order to achieve this all source code is compiled into objects that can ultimately be linked together into a OneScript executable image.

Objects are produced in a binary format that need to linked together for final execution by the OneScript Runtime.

Basic Data Structures

An object is made up of the following basic data structures:

Name Type Description
byte byte An 8 bit unsigned value
integer 32 bytes A 32 byte unsigned value
string string An integer followed by a byte array defining a Unicode string value,
date date
byte array byte array

By following these basic data structures for all objects it is possible to transfer objects to any platform capable of running OneScript stuff!!!

Object Format

Every object the Linker handles follows a standard structure in JSON that is similar to a Macro Program . An object is declared as a module that contains the following:

Name Type Description
Name string Name of the object
Location string The physical location of the object.
Entry Point integer For an object that can be started up
Entry Call Count integer
Using List Using List A collections of using statements
Classes Classes A collections of classes

Basic Information

The basic information tells the Linker how to deal with the object. It includes the following information:

Name Type Description
Name string
Location string File specification of the location of the source code.
Entry Point

Using List

The using list is list of references to other objects that must be available in the reference folder or specified in the command line of the Linker process.

Classes

A list of classes that make up the object. Each list must contain the following information:

  1. Name
  2. Fields
  3. Methods