String length

md_sgf

Member
I have (finally) created an action block to easily count the number of characters in a string.

Is there any other ways to do this? Just interested. It works fine (for my small needs).

I'm unsure if I should clear the array at end. Do local action block variables stay in memory after exiting action block?


StrLen.png
 

Attachments

  • StrLen.ablock
    5.2 KB · Views: 4

Dm114

Well-known member
I have (finally) created an action block to easily count the number of characters in a string.

Is there any other ways to do this? Just interested. It works fine (for my small needs).

I'm unsure if I should clear the array at end. Do local action block variables stay in memory after exiting action block?


View attachment 9276
As @Dev777 just showed you, it's much more efficient: strlen is a Magic Text... 😉

According to Action blocks, no you need not erase them as all variables are set to their default value before exiting.
 

md_sgf

Member
I have no idea why i didn't that there! I've hunting "high and low" for that for ages! Couldn't see the tree for the forest! :rolleyes:

I think this thread needs to be moved to Help and Troubleshooting forum now probably. lol
 
Top