This exercise is meant to give you a basic understanding of primitive variables.
Create variables
Create the following four variables:
- forename (String)
- surname (String)
- age (int)
- learning (Boolean)
Give the variables relevant content, and compose a trace() statement, that mixes the variables with literal text.
Create Integers
- Create two variables called positive and negative of the type uint and int.
- Give them both the value of -5
- Send them to the output panel with a trace() statement, and pay attention to the value that unsigned integer gives.
Numbers and rounding
- Create two variables called floating and integer of the type Number and int.
- Give them both the value of 1.234
- Send dem til output panelet med en
- Send them to the output panel with a trace() statement, and pay attention to the rounding of the integer.
- Give the variable integer the value 12 (after the trace) and send it again to the output window.
References
Variables
Datatypes
Syntax
String, Number, int, uint, Boolean