When a value is returned to LiveCode from a LiveCode Builder library what type will it be?
Because LCB is strongly typed and LiveCode Script is weakly typed for most LCB types we don’t need to worry about it.
- nothing
- Boolean
- Integer
- Real
- Number
- String
- Data
All these types can be used directly in expressions or put into a LiveCode Script variable.
The two exceptions are LiveCode Builder lists and arrays.
List conversion
When a LiveCode Builder handler returns a list it is converted to a numerically keyed LiveCode array, with continuous numerical key.
LiveCode Builder
variable tLetterList put ["a","b","c"] into tLetterList return tLetterList
LiveCode Script
Array conversion
When a LiveCode Builder handler returns an array it is converted to a LiveCode array.
LiveCode Builder
variable tSpain put "Madrid" into tSpain["name"] put "3,165,000" into tSpain["population"] return tSpain
LiveCode Script