Variable Initialization Pro Preview

Initializing a variable means giving it a starting value/data.

To access the full video please subscribe to FLLCasts.com

Subscribe

  • #1309
  • 30 May 2019

Initializing a variable begins by adding a variable block from the red palette:content picture

Every variable must have its own name, with which it can be distinguished. When you want to change the information a variable store inside, you'll need to call it by name, and that's why it's a good practice to give the variables, names that hint what information they store. Also, they have to start with some information already stored in them.

In this example, you can see how a variable with the name "count" is initialized with the starting value of 15:

Courses and lessons with this Tutorial

This Tutorial is used in the following courses and lessons

Image for Instructors Remote Training
  • 136
  • 280:11
  • 156
Image for Robotics with LEGO - Level 3.5 - Measuring tools
  • 58
  • 0:00
  • 185
Image for Lesson 5 - Piggy bank. Counting money
  • 7
  • 5
  • 2
  • 3d_rotation 1
Image for Robotics with LEGO - Level 4.0 - Kinesthetic and Memory Game (in development)
  • 59
  • 2:58
  • 200