Changes

Redesign
Line 1: Line 1: −
Variables can be used to store values (numbers, text strings and true/false conditions). These values can be set in the [[Action: Set Variable|Set Variable Action]]. Variables can be used throughout the app as Triggers and Conditions, and can be used for controlling specific Macrodroid and system settings.
+
== Introduction ==
 +
<pre style="background-color: #ACC8E5; color: #112A46; border-radius: 10px; padding: 10px;">
 +
Variables can be used to store values (numbers, text strings and true/false conditions). These values can be set in the Set Variable Action. Variables can be used throughout the app as Triggers and Conditions, and can be used for controlling specific Macrodroid and system settings.
 +
</pre>
 +
''''' An introduction video is available here '''''
 +
https://www.youtube.com/watch?v=0V_EcyhxrpA&t=1s
 +
<br>
   −
An introduction video is available here: https://www.youtube.com/watch?v=0V_EcyhxrpA&t=1s
+
==<p><b>Global / Local Variables </b></p>==
   −
<strong>Global Variables</strong>
+
=== Local ===
 +
<pre style="background-color: #ACC8E5; color: #112A46; border-radius: 10px; padding: 10px;">
 +
Local variables are specific to an individual macro. You should use a local variable when the value is only required in that individual macro. Local variables are accessed via the edit macro screen.
 +
</pre><br>
    +
=== Global ===
 +
<pre style="background-color: #ACC8E5; color: #112A46; border-radius: 10px; padding: 10px;">
 
Global variables are available throughout the application from any Macro. You should use global variables when you need to store a value between more than a single macro. The list of global variables can be accessed via the Variables tile on the home screen. From this screen you can add, delete and change the value of a global variable.
 
Global variables are available throughout the application from any Macro. You should use global variables when you need to store a value between more than a single macro. The list of global variables can be accessed via the Variables tile on the home screen. From this screen you can add, delete and change the value of a global variable.
 +
</pre><br>
 +
 +
==<p><b>Standard Variable Types</b></p>==
 +
 +
=== Boolean ===
 +
<pre style="background-color: #ACC8E5; color: #112A46; border-radius: 10px; padding: 10px;">
 +
type allows 2 states: True or False
 +
</pre><br>
   −
<strong>Local Variables</strong>
+
=== Integer ===
 +
<pre style="background-color: #ACC8E5; color: #112A46; border-radius: 10px; padding: 10px;">
 +
type is to store positive or negative numbers without decimal part, in order to make any kind of mathematical calculations or comparison.
 +
</pre><br>
   −
Local variables are specific to an individual macro. You should use a local variable when the value is only required in that individual macro. Local variables are accessed via the edit macro screen.
+
=== Decimal ===
 +
<pre style="background-color: #ACC8E5; color: #112A46; border-radius: 10px; padding: 10px;">
 +
type is to store any positive or negative numeric value, with or without decimal digits, in order to make any kind of mathematical calculations or comparison. Sientific notation as 1.3E-2 may be used.
 +
</pre><br>
   −
<strong>Standard Variable Types</strong>
+
=== String ===
 +
<pre style="background-color: #ACC8E5; color: #112A46; border-radius: 10px; padding: 10px;">
 +
type contains any kind of character (alphanumeric ones or any special ones, such as line feed/carriage return/new line or emojis). HINT: an individual string variable can hold up to 500,000 characters, however it is advisable to avoid very long strings where possible. If you should use strings of great length it is recommended to clear them when finished with.
   −
A variable can belong to 1 of the 4 following types: <strong>Boolean, Integer, Decimal</strong> or <strong>String</strong>.
+
</pre><br>
* <strong>Boolean</strong> type allows 2 states: True or False
  −
* <strong>Integer</strong> type is to store positive or negative numbers without decimal part, in order to make any kind of mathematical calculations or comparison.
  −
* <strong>Decimal</strong> type is to store any positive or negative numeric value, with or without decimal digits, in order to make any kind of mathematical calculations or comparison. Sientific notation as 1.3E-2 may be used.
  −
* <strong>String</strong> type contains any kind of character (alphanumeric ones or any special ones, such as line feed/carriage return/new line or emojis). <i>HINT: an individual string variable can hold up to 500,000 characters, however it is advisable to avoid very long strings where possible. If you should use strings of great length it is recommended to clear them when finished with.</i>
      +
==<p><b>Data Structure Variable Types</b></p>==
   −
<strong>Data Structure Variable Types (Pro Only)</strong><br/>
+
=== Array ===
''Available in v5.23''
+
<pre style="background-color: #ACC8E5; color: #112A46; border-radius: 10px; padding: 10px;">
 +
stores a series of values with associated index variables. For example if you wanted to store a count for each day of the month you could create an array called dayOfMonthCount and have a series of entries such as dayOfWeekCount[1] = 5, dayOfWeekCount[2] = 2 etc.
 +
</pre><br>
   −
An introduction video is available here:
+
=== Dictionary ===
https://youtu.be/u2zY5dv34CM
+
<pre style="background-color: #ACC8E5; color: #112A46; border-radius: 10px; padding: 10px;">
* <strong>Dictionary</strong> stores a series of key value pairs. For example if you wanted to store a count for each day of the week you could create a dictionary called dayOfWeekCount and have a series of entries such as dayOfWeekCount [monday] = 1, dayOfWeekCount [tuesday] = 3 etc.
+
stores a series of key value pairs. For example if you wanted to store a count for each day of the week you could create a dictionary called dayOfWeekCount and have a series of entries such as dayOfWeekCount [monday] = 1, dayOfWeekCount [tuesday] = 3 etc.
* <strong>Array</strong> stores a series of values with associated index variables. For example if you wanted to store a count for each day of the month you could create an array called dayOfMonthCount and have a series of entries such as dayOfWeekCount[1] = 5, dayOfWeekCount[2] = 2 etc.
+
</pre><br>
editors
1,597

edits