DictionaryGetFloat

Famille: Dictionary · 2 formes

Ce que fait la commande

DictionaryGetFloat prend dictionary (un entier) et key (une chaîne), et rend un flottant. C'est la première de 2 formes.

Syntaxe

1
DictionaryGetFloat(dictionary integer, key string) → float
2
DictionaryGetFloat(dictionary integer, key string, defaultValue float) → float

Paramètres

NomTypeDans les formes
dictionaryintegertoutes
keystringtoutes
defaultValuefloat2

Chaque forme rend

float

Exemple · engendré

Forme 1 : la plus courte

DO  Print(DictionaryGetFloat(1, "score"))  Sync()LOOP

Forme 2 : avec tous les arguments

DO  Print(DictionaryGetFloat(1, "score", 1.0))  Sync()LOOP

DictionaryGetFloat est appelé et sa réponse est affichée à chaque image. La boucle DO … LOOP n'est pas décorative : un programme BASIC classique s'arrête dès qu'il n'a plus de lignes, et c'est Sync() qui dessine l'image.

17 commandes dans Dictionary