-
Notifications
You must be signed in to change notification settings - Fork 0
Variables & Data Types
Variables in Nova are declared using the have keyword. You don't need to specify a type (like int or string) manually, Nova infers the type based on the assigned value.
- Syntax:
have <variableName> = <value> - Example:
have appName = "Nova Showcase"
have version = 1.2
have clickCount = 0
Dynamic Updates
Variables in Nova can be updated throughout the script. You do not need to use the have keyword again when changing the values of existing variables.
- Example:
have timer = 5
timer = timer - 1 // The variable 'timer' is now 4
Nova supports several core data types that can allow you to handle text, numbers, and collections of data.
1. Strings
Strings are used for text and are wrapped in double quotes. You can combine strings and variables using the + operator.
- Example:
put("Initializing " + appName)
2. Numbers
Nova handles both whole numbers (integers) and decimals (floats) automatically.
- Example:
have timer = 5
3. Arrays
Arrays allow you to store multiple values in a single variable. They use square brackets [] and are zero-indexed (the first item is at position 0). You also need to add a comma , after each variable to make sure they are all connected.
- Declaration: have fruits = ["apple", "banana", "cherry"]
Join our discord server for any support or questions that you need answered!
Link: