Datentyp

Aus microbit - Das Schulbuch
Wechseln zu: Navigation, Suche

Was ist das?

In Variablen werden Werte und Ergebnisse zwischengespeichert. Der "Inhalt" einer Variablen kann an jeder Stelle im Programm und zu jeder Zeit verwendet (abgefragt) oder verändert werden.

input.onButtonPressed(Button.A, function () {
    basic.showNumber(lieblingszahl)
    basic.showString(lieblingswort)
    lieblingssymbol.showImage(0)
})
let lieblingssymbol: Image = null
let lieblingswort = ""
let lieblingszahl = 0
lieblingszahl = 5
lieblingswort = "Hi"
lieblingssymbol = images.iconImage(IconNames.Happy)