VisualNEO (Neobook) Clear Variables from StrParse - Forum

Forum Navigation
You need to log in to create posts and topics.

VisualNEO (Neobook) Clear Variables from StrParse

I have a string like this:

test another more test4 blah

and "Space" is delimiter of this list of words.
I use StrParse command to parse them into: [Parse] variable.
[Parse1], [Parse2], [Parse3] and so on...

a lot of variable will be created. For some reason to fix some conflict in my app i need to clear all parsed variables.

i can use Clear Variable command like this:

ClearVariables "[Parse1],[Parse2],[Parse3]"

But in this case i have a dunamic list of words which contains a lot of words in random number, and dont know how many they are.

How can i remove all Parsed Variables?

I tried to Use ClearVariables and remove main variable [Parse], but child variables [Parse1], [Parse2]... will not get removed.

ClearVariables "[Parse]"

Any solution for this?

@noyzen

Try ...

DeleteArray "Parse" "All"

Also, when you do a StrParse, if you specify a variable in the fourth (final) parameter, it will contain the number of parsed elements ... you can then use a Loop/EndLoop code block to remove the element variable.

noyzen has reacted to this post.
noyzen

Thanks @gaev

i know about total variable but in my case i cant use it because i created (for example) 10 parses and in next loop i create 5 parses. so previous parse will remain even if i remove last 5 parses. (sorry if its confusing).

i think DeleteArray is what im looking for, i will try it!

@noyzen

in my case i cant use it because i created (for example) 10 parses and in next loop i create 5 parses. so previous parse will remain even if i remove last 5 parses

You might be able to use ...

GetArrayInfo "[Name]" "[FirstItem]" "[LastItem]" "[ArraySize]"

... and use [FirstItem] and [LastItem] in your Loop/EndLoop code block.

You still might have a situation where items within the range are empty; but using SetVar to make them empty will not do any harm.

noyzen has reacted to this post.
noyzen

Hi again, @gaev

DeleteArray "[Parse]" "All"

I tested and this command simply work for me! Thank you bro :)