From 3b8ae69a6c8be193b5109410e855ab36a411a5ff Mon Sep 17 00:00:00 2001 From: Ron Hale-Evans Date: Tue, 24 May 2016 15:36:04 -0700 Subject: [PATCH] Rewrite of text and examples. --- docs/reference/variables/assign.md | 32 +++++++++++++++--------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/docs/reference/variables/assign.md b/docs/reference/variables/assign.md index de27860b..95f20dc6 100644 --- a/docs/reference/variables/assign.md +++ b/docs/reference/variables/assign.md @@ -1,34 +1,34 @@ # Assignment Operator -Set the value for local and global variables. +Use an equals sign to make a [variable](/reference/variables/var) store the [number](/reference/types/number) +or [string](/reference/types/string) you say. -### @parent blocks/operators +When you use the equals sign to store something in a variable, the equals sign is called +an *assignment operator*, and what you store is called a *value*. -Set or change the value of a variable +### Storing numbers in variables + +This program makes the variable `item` equal `5` and then shows it on the [LED screen](/device/screen). ````blocks -let item = 0 +let item = 5 +basic.showNumber(item) ```` -Use the assignment operator to set or change the value of a [variable](/reference/variables/var). +### Storing strings in variables -### Declare a variable - -Declare a new *local* variable using the [variable](/reference/variables/var) statement and the assignment operator. Like this: +This program makes the variable `name` equal `Joe` and then shows it on the [LED screen](/device/screen). ````blocks -let num1 = 42; -let name = "Joe"; +let name = "Joe" +basic.showString(name); ```` -The variable's name is on the left of the assignment operator and the variable's value is on the right: - -````blocks -let num1 = 42 -```` ### Notes -* You can use the assignment operator with variables of each of the supported [types](/reference/types). +You can use the assignment operator with variables of +every [type](/reference/types). A *type* is which kind of thing +a variable can store, like a number or string. ### Lessons