Multiple variables

  • Thread starter Deleted member 9002
  • Start date
D

Deleted member 9002

Guest
I want to make a macro which everyday at 12'O clock makes a variable (named variable) and stores a value (of another variable)
 

Snurre

Well-known member
I don't think you can create a new var with a macro, but you can use a predefined and set the value
Something like this should do it

Screenshot_20220709_202459_com.arlosoft.macrodroid.jpg
Between the two actions do whatever you feel for 😉
 
Last edited:

Dm114

Well-known member
It's on my TODO list :)
I just found something weird in the Template store!

I guy shared a macro (in Japanese) and asap you open it (even without launching it) it creates a lot of permanent global variables on your device: how is it possible, as creating them dynamically is not possible yet? 🤔🤔

Here's the link to this macro:

I thought that calling an Action block that creates such variables would be the explanation (as he does) but it doesn't work... ☹️
 

dsnz

Well-known member
I just found something weird in the Template store!

I guy shared a macro (in Japanese) and asap you open it (even without launching it) it creates a lot of permanent global variables on your device: how is it possible, as creating them dynamically is not possible yet? 🤔🤔

Here's the link to this macro:

I thought that calling an Action block that creates such variables would be the explanation (as he does) but it doesn't work... ☹️
obviously MD creates them as part of the loading process (restore of the macro from the exported file) since this macro references these global variables

think .. if you had such a macro of your own, then saved it to file and then
loaded this file in another phone without macros ... the same thing would happen
 

Dm114

Well-known member
obviously MD creates them as part of the loading process (restore of the macro from the exported file) since this macro references these global variables

think .. if you had such a macro of your own, then saved it to file and then
loaded this file in another phone without macros ... the same thing would happen
The problem is with global variables. They shouldn't be "exported" to and from the Template store because they shouldn't be part of an exportable macro. It's up to the programmer not to use this kind of variables but only local ones. Macros should be "autonomous".
 

dsnz

Well-known member
why shouldn't be part of an exportable macro ? (and what's an "exportable" macro exactly ?)
MD does it's job when exporting/importing macros so that the final imported macro works
I think your issue is about your expectations from macros in the store, but the store is an open place and well some people use global variables .. we can't be kind of programming police 😂
you can examine a macro before importing into your device and decide if you like to import it as is or not or rewrite it (as I do often 😂)
 

Dm114

Well-known member
why shouldn't be part of an exportable macro ? (and what's an "exportable" macro exactly ?)
MD does it's job when exporting/importing macros so that the final imported macro works
I think your issue is about your expectations from macros in the store, but the store is an open place and well some people use global variables .. we can't be kind of programming police 😂
you can examine a macro before importing into your device and decide if you like to import it as is or not or rewrite it (as I do often 😂)
You seem to be very wise but there are some things and strange behavior you don't seem to be aware of.

For instance, try to "examine before importing" the japanese macro with the link above...
 

dsnz

Well-known member
You seem to be very wise but there are some things and strange behavior you don't seem to be aware of.

For instance, try to "examine before importing" the japanese macro with the link above...
I got you mean, but better let's state more clearly the issue

when viewing a macro from the store
and exiting without pressing the + button to add it to our macros
then the global variables of this macro remain when they should have been deleted (or should not have been created in the first place)
this is a bug of the function to view a macro of the store
and @MacroDroidDev should fix it
 

Dm114

Well-known member
I got you mean, but better let's state more clearly the issue

when viewing a macro from the store
and exiting without pressing the + button to add it to our macros
then the global variables of this macro remain when they should have been deleted (or should not have been created in the first place)
this is a bug of the function to view a macro of the store
and @MacroDroidDev should fix it
A global variable (as well as a local one) cannot be deleted programmatically. It can just be cleared. Which is very different!
 
Top