Hi there,
can someone explain the json.removeAll command to me and give an example?
I'm looking for a way to clear the content of an array. Either I do that with:
[h: test.arr = '[]']
or with (short from my memory without exam):
[h, while((json.length (test.arr) > 0), code:
{[h: test.arr = json.remove(test.arr, 0)]}
Thanks for the support!
TeeJot
json.removeAll application
Moderators: dorpond, trevor, Azhrei, giliath, jay, Mr.Ice
Re: json.removeAll application
Never had to use this but I assume something like this
Looks like the same functionality as json.difference(). In your example, I would just stick with json.remove.
Code: Select all
[H: obj = json.set("{}","name","Monster Name","size",2,"color","blue")]
<!-- remove color -->
[H: obj = json.removeAll(obj,json.set("{}","color",""))]
Downloads:
- Notepad++ MapTool addon
- RPEdit details (v1.3)
- Coding Tips: Modularity and Design
- Videos: Macro Writing Tools