String variable length of an array?

So basically I have 3 integer variables:
• |04| Index
• |04| Max Length
• |04| Current Length (the one in the picture)

And an array:
• |04| Owned

This is just for context, the problem I'm having is with "|04| Current Length".

I'm wondering how can I extract the string length within an array which I'm defining with "|04| Index" and the reason I'm defining the index this way is because this macro is suppose to automatically create a new string within the array and increment "|04| Index" once it detects that "|04| Max Length" is less than "|04| Current Length" (prevents me from going over the character limit for strings).

Problem is what you see in the picture where I'm trying to set the string length to "|04| Current Length" of a string within the array that I'm defining with "|04| Index", but it gives me this message. It works when I'm not using "|04| Index" to define the index.

Hope I made this easy to understand. If anyone knows what I'm doing wrong or if there's another way to go about doing this them please let me know. Also let me know if you need more context or pictures.

Edit: Hope my only solution isn't to copy the string to another outside of the array and then compare from there, I feel like it'd be less efficient at this point.
Screenshot_20230513_144932_MacroDroid.pngScreenshot_20230513_145019_MacroDroid.png
 
Last edited:
On a separate note, I was able to successfully add to a string within the array as seen in the picture, just need to figure out how to solve this problem so this can work properly.Screenshot_20230513_154921_MacroDroid.png
 

Endercraft

Moderator (& bug finder :D)
I just tried this. It seems to be a bug of some sort where all the magic text is not evaluated (the strlen function has been known to have some problems with dictionaries/arrays). Report the bug using the report bug button in the troubleshooting section.
A workaround until this gets fixed is to first set a string variable outside a dictionary/array to the expression you are entering then use the strlen function on that.
 
I just tried this. It seems to be a bug of some sort where all the magic text is not evaluated (the strlen function has been known to have some problems with dictionaries/arrays). Report the bug using the report bug button in the troubleshooting section.
A workaround until this gets fixed is to first set a string variable outside a dictionary/array to the expression you are entering then use the strlen function on that.
I see, thx for the response.
Edit: Another method I just thought of is instead of comparing string length, I'll just increment an integer till it hits a certain number.
 
Last edited:
Top