Types
OSL supports six fundamental data types that can be used to represent various kinds of data.
String
Text values enclosed in double quotation marks.
// Basic string
name = "Hello"
// String with spaces
message = "Hello, World!"
// String with special characters
path = "C:/Users/Documents"Boolean
Logical values representing true or false (case-insensitive).
// Boolean values
isTrue = true
isFalse = false
// In conditions
if true (
log "This will execute"
)
// Boolean operations
result = true and false // falseNumber
Numeric values including integers and decimals.
Array
Ordered collections of values enclosed in square brackets.
Object
Key-value collections enclosed in curly braces.
null
Represents an empty or undefined value.
Type Checking
You can check the type of a value using the typeof() function:
Important Notes
Strings must use double quotes (
")Booleans are case-insensitive (
Trueortrue)Numbers must match the pattern
[0-9.\-]+Arrays can contain mixed types
Object keys don't need quotes
nullrepresents absence of valueAll types support the
.getType()method
Last updated
Was this helpful?