You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 19, 2024. It is now read-only.
itevie edited this page Sep 13, 2023
·
3 revisions
Variables in Zephyr work mostly like every other language.
Creating variables
Creating variables is done using the var or const keyword, examples are:
var a = 2; // Creates a variable called "a" with a value of 2 (int)
var int a = 2; // Same as above, though explicitly defining the type and the variable will always be an int
const a = 2; // Same as 1st but the variable can never be reassigned
var int? a = 2; // Same as second, but it can be either null or int type
Using variables
Variables can be used by just using their name somewhere else, for example, adding 2 numbers: