I can't seem to get json.subset() to work in any of the recent versions. It says, "Undefined function: json.subset."
You can test it with,
[h:ja1 = '[1,2,3]']
[h:ja2 = '[1,2]']
[r:jaCheck = json.subset(ja1,ja2)]
Returns,
Undefined function: json.subset
Though, this is fixable by just defining yourself with...
[ ja1 = arg( 0 ) ]
[ ja2 = arg( 1 ) ]
[cSubset = 1]
[foreach(s1,ja2),code:{
[cContains = json.contains(ja1,s1)]
[if(cContains && cSubset):cSubset = 1; cSubset = 0]
}]
[macro.return = cSubset]
[FIXED ]Is json.subset Broken?
Moderators: dorpond, trevor, Azhrei, giliath, jay, Mr.Ice, MapTool BugReport Manager
-
- Cave Troll
- Posts: 33
- Joined: Thu Aug 02, 2012 9:36 pm
- CoveredInFish
- Demigod
- Posts: 3104
- Joined: Mon Jun 29, 2009 10:37 am
- Location: Germany
- Contact:
Re: Is json.subset Broken?
Confirmed. (Tried the posted code and wrote one myself. Didnt investigated much.)
Re: Is json.subset Broken?
Moved to Bug Reports.
The problem is that the documentation had the wrong function name. It should have been Wiki: json.isSubset(). Sorry! It's been fixed.
Kinda funny that no one detected this until now though.
The problem is that the documentation had the wrong function name. It should have been Wiki: json.isSubset(). Sorry! It's been fixed.
Kinda funny that no one detected this until now though.