LET

From Smart Box
Jump to navigation Jump to search

Syntax[edit]

LET variable = value

Description[edit]

The command LET is used to assign a value to a variable. Variables are used as a temporary place to store numbers, strings or time values. Variables can be up to 15 characters in length.

Example[edit]

Give the variable ‘x’ the value 10

LET x = 10

Add 1 to the current value of the variable ‘x’ and put the result into the variable ‘turns’

LET turns = x+1

Put the time value 10 seconds into the variable ‘MyTime’

LET MyTime = :10:0

Put a string of text into the variable ‘MyText’. This can be useful where a long string of text is needed at a number of points in a program. Rather than typing the string in every time the variable can be printed.

LET MyText = "This is a message"

Associated keywords[edit]