Hi,
I am trying to use a Javascript Map in a Report, but when I try to create a Map like this:
var newMap = new Map([
["key",value]
])
I get "ReferenceError: "Map" is not defined."
How can I use JavaScript Maps in ARIS Script?
Kind Regards,
Bennet
Thank you for the Reply, Robert!
Fixed one issue, but now I have another problem here: (This code window seems to be a bit broken, I hope its still somewhat readable...)
myMap.forEach(function (key, value) {
outfile.TableRow();
outfile.TableCell(key,20,"Arial",10,Constants.C_BLACK,Constants.C_WHITE,0,Constants.FMT_CENTER,0);
outfile.TableCell(value,20,"Arial",10,Constants.C_BLACK,Constants.C_WHITE,0,Constants.FMT_CENTER,0);
})
I get the following error now: "Cannot convert function to interface.java.util.function.BiConsumer since it contains methods with different names"
Do I have to change my foreach implementation?
Best regards,
Bennet
I always do it like this:
asKeySet = g_mConnectionsFound.keySet().toArray();
for (i = 0; i < asKeySet.length; i++){
sValue= g_mConnectionsFound.get(asKeySet[i] + "");
outfile.TableRow(); outfile.TableCell(asKeySet[i],20,"Arial",10,Constants.C_BLACK,Constants.C_WHITE,0,Constants.FMT_CENTER,0); outfile.TableCell(sValue,20,"Arial",10,Constants.C_BLACK,Constants.C_WHITE,0,Constants.FMT_CENTER,0);
}