Data types
A list of data types you can use with the Packhunt Workbench.
Blocks can store, use and transfer data. The data value can be of various types includingNumber
, String
, Boolean
, List
and Dictionary
. When defining, receiving and sending data, the underlying data type must match for successful results.
See the table below for explanation on valid data types.
Data type | Definition | Example |
---|---|---|
Number | Quantitative values which can be negative or positive and integers or floats. Empty value is null . |
1000 -1000 50.5 |
String | Combination of characters, digits, or symbols, always treated as text. Empty value is “” or null . |
“abc" ”a123” ”5” |
Boolean | True or false values, which can be represented by 1s and 0s. Empty value is null . |
true (1) false(0) |
List | List of values that all have the same type. Empty value is [] or null . |
See the examples below. |
Dictionary | Collection of items in key-value pairs. Empty value is {} or null . |
See the examples below. |
Lists are configured like the example below.
key1: [value1, value2]
# or
key1:
- value1
- value2
# or
- key1: value1
key2: value2
- key1: value1
key2: value2
See the configuration example for Packhunt configuration language below.
areas: #list
[block1, block2]
# or
areas: #list
- block1
- block2
# or
subscribe: #list
- kind: ControlPanel
frame: my-frame
source: my-controlpanel
- kind: EntityDataStore
frame: my-frame
source: my-entity-data-store
Dictionaries are configured like the examples below.
key1: value1
key2: value2
# or
key:
key1: value1
key2: value2
See the configuration examples for Packhunt configuration language below.
assignMaterials: #dictionary
box-geometry: blue-material
sphere-geometry: red-material
.....
properties: #dictionary
height:
type: Number
default: null
nullable: true
width:
type: Number
default: null
nullable: true
Undefined and empty values
Value | Definition |
---|---|
undefined |
The value of the property isn’t set yet. The desired action (e.g. Model solve or Insert entity) may not take place as a consequence. It’s not possible for a user to set a value to undefined. |
null |
The value of the property is (intentionally) assigned no value. Is only a valid value depending on the property settings. Can be set by the user. |
"" |
The value of the property is of type String with zero characters. Can be set by the user. |
[] |
The value of the property is of type List with zero items. Can be set by the user. |
{} |
The value of the property is of type Dictionary with zero key-value pairs. Can be set by the user. |