Sketchware Docs (Unofficial)
  • Introduction (Under Construction)
  • Official Docs
  • Introduction to Sketchware
    • Adding your app
    • Designing and Programming your app
  • Widgets and Layouts
    • Concept
    • Properties
    • List of Widgets and Layouts
  • Events
  • Blocks
    • Variable
    • List
    • Control
    • Operator
    • Math
    • File
    • View
    • Component
    • More Block
  • Components
    • About Components
    • Intent
    • SharedPreference
    • Calendar
    • Vibrator
    • Timer
    • Dialog
  • Configuration
  • AdMob Guide
  • Community
Powered by GitBook
On this page
  • What is a variable?
  • Different kinds of Variables
  • Boolean
  • Number
  • String
  • Map
  • Blocks
  • Set Boolean to
  • Set Number to
  • Increase 1
  • Decrease 1
  • Set string to

Was this helpful?

  1. Blocks

Variable

PreviousEventsNextList

Last updated 4 years ago

Was this helpful?

What is a variable?

Think of a variable as a bucket. You can put values into it and remove values from it. To reference the variable, you must use its name.

Keep in mind that variable values aren't saved, so when the app is closed, they get reset. You can use the block with a ToStringWithoutDecimal block to save their values.

Different kinds of Variables

There are four different kinds of variables in Sketchware:

Boolean

Booleans accept values like true and false

Number

Number variables accept numbers

String

String variables accept a string (text)

Map

Map variables are for making maps with key:value pairs

Blocks

Set Boolean to

Sets a boolean variable to True or False

Set Number to

Sets a number variable to the specified value

Increase 1

Increases the number variable by 1

Decrease 1

Decrease the number variable by 1

Set string to

Sets a string variable to the specified value

SharedPreference