Names of global variable should be mentain when adding them to in local variable

OscariBot

Active member
Hi
I am a huge macrodroid fan.
I noticed that when you add a global variable into a local variable, the global variable disappeared from the local variable leaving only it content after the macro is activated.
Please can this be corrected?

Thanks
 

MacroDroidDev

Administrator
Staff member
Sorry I can't work out what you mean from your description. Could you please clarify exactly what the issue is. A set of simple steps is usually the best way to make things clear.
 

OscariBot

Active member
Let me try to go step by step.

Assuming you create a global variable "[v=name]" and it content is "JOHN"
Now create a local variable "[lv=sentence]" and it content is "MY NAME IS "
Then add the "[v=name]" to the local variable so it looks like this "MY NAME IS [v=name] "

When you execute this macro it works very well by merging d content of local variable MY NAME IS + [v=name] as expected. and it also change to "MY NAME IS MARY" when the content of [v=name] change to "MARY" just as exoected.

But when you reopen the local variable for some reason the variable [v=name] disappeared leaving it last executed content i.e "MARY" hence the local variable keep returning my "MY NAME IS MARY" not minding the content of [v=name]. Until reconfigured again.

But when i convert [v=name] to local variable it works perfectly well.

I hope my explaination is understood..

Thanks
 

dsnz

Well-known member
maybe it's a bug concerning global variables, @MacroDroidDev will say what happens but it would be good to clarify 2 things

1. you say you used a [v=...] inside a variable and it gives the impression that
you did this by editingt he local variable and including it inside the text
I don't think this works so perhaps you really mean that
you used the "set variable" action ??

2. you say you converted a global variable to a local variable (near the end of your post), how did you do this ?? there is no conversion mechanism, so ..
by deleting the global variable and making a new local variable ? or by keeping the original global variable and creating a new local variable with same name ?
 

OscariBot

Active member
Ye
maybe it's a bug concerning global variables, @MacroDroidDev will say what happens but it would be good to clarify 2 things

1. you say you used a [v=...] inside a variable and it gives the impression that
you did this by editingt he local variable and including it inside the text
I don't think this works so perhaps you really mean that
you used the "set variable" action ??

2. you say you converted a global variable to a local variable (near the end of your post), how did you do this ?? there is no conversion mechanism, so ..
by deleting the global variable and making a new local variable ? or by keeping the original global variable and creating a new local variable with same name
1) Yea if you typed the name of a variable into a local variable correctly, it will apply the content into the host variable just like i did above

2) Yea you can convert a global variable to local by opening variables page then under each variable there is an option to convert a variable to local variable. But this is only possible if the variable is not shared by two or more macros.
 

dsnz

Well-known member
about 2. you are right, I had forgotten this since I don't use much global variables
however, when I make a test macro for 1. and use a new global variable it doesn't show me that it's used by the macro (it's just an unused variable)

about 1.
yes , I did a test macro and what you say does work (!)
but after first use the [v=...] has been replaced ,
but if instead I use a [lv=...] it stays in the variable text
so.. it's not an issue about conversion but rather that this replacement
(this magic replacement 😂)
is permanent if using a reference to a global variable
but is not permanent and the reference stays for a local variable

I think @MacroDroidDev didn't have in mind such use of variable reference 😂 (see my notice in 1. in that the global variable appears to be free and not used by any macro)
but nevertheless he will be able to make this trick work repeatedly for global variables too 😊
 

OscariBot

Active member
about 2. you are right, I had forgotten this since I don't use much global variables
however, when I make a test macro for 1. and use a new global variable it doesn't show me that it's used by the macro (it's just an unused variable)

about 1.
yes , I did a test macro and what you say does work (!)
but after first use the [v=...] has been replaced ,
but if instead I use a [lv=...] it stays in the variable text
so.. it's not an issue about conversion but rather that this replacement
(this magic replacement 😂)
is permanent if using a reference to a global variable
but is not permanent and the reference stays for a local variable

I think @MacroDroidDev didn't have in mind such use of variable reference 😂 (see my notice in 1. in that the global variable appears to be free and not used by any macro)
but nevertheless he will be able to make this trick work repeatedly for global variables too 😊

about 2. you are right, I had forgotten this since I don't use much global variables
however, when I make a test macro for 1. and use a new global variable it doesn't show me that it's used by the macro (it's just an unused variable)

about 1.
yes , I did a test macro and what you say does work (!)
but after first use the [v=...] has been replaced ,
but if instead I use a [lv=...] it stays in the variable text
so.. it's not an issue about conversion but rather that this replacement
(this magic replacement 😂)
is permanent if using a reference to a global variable
but is not permanent and the reference stays for a local variable

I think @MacroDroidDev didn't have in mind such use of variable reference 😂 (see my notice in 1. in that the global variable appears to be free and not used by any macro)
but nevertheless he will be able to

You are right .. I didnt even notice that the variable appear as unused even when its. use by d local variable.
I think @MacroDroidDev will giv it some attention
 

OscariBot

Active member
Hi @MacroDroidDev.
Please reply why the abov issue isn't resolved as expected in the latest version. Am just curious to know because you said "this is just a display issue so will be an easy fix and I will update for the next release."

Thanks
 

OscariBot

Active member
Hi

I really was expecting the above thread resolved on the current version of macrodroid as you said earlier ''this is just a display issue so will be an easy fix and I will update for the next release."

I was really anticipating this fix.

Thanks for the great work
There has been no update since I wrote, so the fix isn't available yet.
 

OscariBot

Active member
Hi @MacroDroidDev
Please I wish to know if I should reconfigure my macro to use local variables as I was seriously anticipating this thread to be resolved.
Am still curious to know why it's pending..

PLEASE REPLY
 

OscariBot

Active member
My dear FrameXX

I manage to go through my message over and over again trying to spot what I said wrong and found non.

Jamie has already explain that he is an independent developer and ofcouse i know he hav other things doing more than responding to us here and I respect that and every other person here.
I am not compelling him, you or any other member here to respond to me...
all I did was to create an urgency so that anytime Jamie found himself here he will giv this thread some attention.
Don't make me look stupid as if I don't know what a forum is.

Please anyone should go through my previous conversion asper this thread and compare it to my last message then judge if I actually say something I shouldn't.

Please keep in mind that other people including Jamie do not need to have time for you just right now or in any other moment you have a free time and want a response. They are responding you because they want and have time for it, not because they must or need to. Please respect that.
 
Top