<< Click to Display Table of Contents >> Home mIoTa BASIC > mIoTa BASIC Language Reference > Variables > User Variables |
There are a possible 128 user variables slots available to the user program. Each variable needs to be declared before being used.
Each of the User Variables are given unique names ‘U0’ through to ‘U127’. The actual number selected can be altered as required.
The type of variable must be specified from the available data types. The data type you select depends entirely on what the variable is going to be used for the user program.
A 'Friendly Name' can also be specified which can be used in the Event Code editor as an easy to read alternative to the standard 'U0' to 'U127'. This name should be unique and a valid identifier.
Network Access can be granted to any of these variables to allow web pages/network apps to read and write their contents. Disabling network access allows increased security and reduces the possibility of remotely altering variables that shouldn't be altered at runtime.
Clicking the right mouse button on the 'Variables Panel' shows the panel popup ..
Selecting 'New' shows the 'User Variable Settings' popup and allows you to create a new variable ..
The Variable ID of the new variable will be set to the first available free slot from 'U0' to 'U127'. This can be altered if required by left clicking the ID box. You will then be presented with the 'User Variable ID Selector'. This allows you to select any of the available numbered slots. The slots that are already in use and the currently selected slot are highlighted. Only the unused slots that are available can be selected.
When the ID slot has been set, then the type of variable required must be specified. See Data Types for more information.
Lastly the network accessibility for the variable should be enabled if required. This depends on whether you need to use this variable on web pages or linked apps.
Select an existing variable in the 'Variables Panel', right click with the mouse to show the panel popup then select 'Delete' to delete the selected variable from its slot.
Select an existing variable in the 'Variables Panel', right click with the mouse to show the panel popup then select 'Edit' to to show the 'User Variable Settings' popup which allows you to alter all aspects of the currently selected variable.
Select an existing variable in the 'Variables Panel', right click with the mouse to show the panel popup then select 'Copy 'Friendly Name'' to to copy the name to the clipboard so that it can easily be pasted into the Event Code Editor.
Related topics: Data Types, User Variables, O/S Variables