set_type

Defines the properties of a Type. Function set_type works only on a new Type. Use mod_type() if you want to change an existing Type, see mod_type.

This function generates an event.

Function

set_type(type, value)

Arguments

Argument Type Description
type str The name of the Type where the properties have to be set.
value thing Thing containing all the properties to be set.

Return value

The value nil.

Example

This code shows how to use set_type():

set_type('Person', {
    name: 'str',
    age: 'uint',
    hobbies: '[str]'
});

Return value in JSON format

null