Read variable [variable] from file [value] and [option]

Last modified by admin on 2023/11/01 15:15

Reads a specified variable from a specified file and either keeps or deletes the file. This means that variables can be stored permanently, surviving the lifetime of the Pocket Code App and later can be recalled. Only a single variable can be read from each file. You can find the file in the Catrobat root directory.

read-variable-from-file_brick.png

Correlates with this brick:

write-variable-to-file_brick.png
Learn more >>

Example

Writes the current score into a file. When opening the scene, the score is read from the file.

read-variable-from-file_example.png
read-variable-from-file_example_2.png

Result

Download

read-variable-from-file_example.gif