Skip to content

Import

The import keyword loads CES files into the current script.

Imported files can contain:

  • classes
  • functions
  • global variables

The imported code becomes available in the current execution context.


Syntax

import "file";

The .ces extension is optional.


Example

player.ces

class Player {
    Str name : "Thiago";
}

main.ces

import "player";

Inst p : Player();
DisplayLog(p.name);

Output:

Thiago

Import from folders

import "modules/player";

This allows organizing scripts into folders.