System operations are built-in libraries which allow Cuneiform to perform more complex functions. System operations have two sets of attributes.
Before we make use of system operations, they must first be initialized into a variable using the new keyword. Its syntax is as follows.
var varName = new SystemOperation;
The example below shows how the Response system operation is assigned to a variable.
var response = new Response;
Each system operation has its own set of properties. Properties represent characteristics the operation must have to perform. For example, the HTTP operation must have a URL in order to perform HTTP requests.
Property values are assigned by referencing the variable assigned to the system operation, followed by a dot (.) operator, followed by the name of the property, followed by the assignment (=) operator, and finally followed by the value the property is being assigned to. Its syntax is as follows.
varName.propertyName = propertyValue;
The example below shows how a URL is assigned to a variable assigned to the HTTP system operation.
http.url = "https://www.google.com";
Operations represent actions the system operation can perform. Each system operation consists of its own set of operations. For example, the File system operation consists of the actions which allow the application to read from and write to files.
Operations are executed by referencing the variable assigned to the system operation, followed by a dot (.), and finally the name of the operation. Its syntax is as follows.
varName.operation;
The example below shows text being read from a file, and being assigned to a variable using the File system operation's read operation.
var text = file.read;
The following is the list of system operations available in Cuneiform.
The next section discusses the available system operations, and how to use them.