Forum Discussion

JudyNollet's avatar
JudyNollet
Super Hero
8 months ago

The Value of Variables

Variables provide the real power in Storyline. They can help you track selections, control interactions, perform calculations, and so much more.

Simply put, a variable stores data, which is known as its value.

  • The value stays the same until a trigger adjusts it.
  • The value can be displayed and used anywhere in the course.

Based on the type of data it holds, a variable belongs to one of three categories.

True/False variable

A True/False (T/F) variable is like one of those Open/Closed signs that hang in a storefront's window, because there are only two possible options. The value of a T/F variable can only be True or False.

Text variable

A Text variable is like a written note. Its value can contain any combination of keyboard characters.

  • It is possible to enter a number into a Text variable. However, the program will see the value as typed characters, not as a number. Therefore, you can't do math operations on a number in a Text variable.

Number variable

A Number variable is like an entry in a calculator. Because the value can only be numeric, the program can perform math operations on it.

 

Variables can also be divided as follows:

  • Project variables are created within a given .story file.
    • Many Project variables are created manually. However, when you insert a data-entry field (text entry or numeric entry), Storyline automatically creates the appropriate type of variable to hold the value entered in the field.
  • Built-in variables are used for values that might apply to any course. For example, there are built-in variables to control accessibility features, to number slides, and to report quiz results.

 

Tips for working with variables

  • When you create a variable, Storyline gives it a generic name (such as “Variable1,” “TextEntry,” or “NumericEntry”). To make development and troubleshooting easier, give every variable a new, meaningful name.
  • It can help to display a variable’s value in a text box during development. That allows you to check whether the variable changes when expected. If the user doesn’t need to see the value, simply move that text box off the slide, hide it, or delete it before publishing the course.
  • A trigger can be set to run when a variable changes. However, that kind of trigger only works when the variable changes on the same slide as the trigger.

 

It's worth the effort to learn about variables. These links lead to more info.