/* (C) Copyright IBM Corp. 2005, 2011. Licensed Material - Property of IBM Corp. IBM, the IBM logo, and Cognos are trademarks of IBM Corp., registered in many jurisdictions worldwide. */ var = { , : { } , /** * formatString usage: * using param names in message string: * formatString(msg, "name1", "value1", "name2", "value2", ...) * using indexes in message string: * formatString(msg, ["value1", "value2", ...]) */ formatString: function(sourceString) { var result = sourceString; var i, l=arguments.length; if (l == 2 && typeof arguments[1] == "object" && arguments[1].length > 0) { // second argument is an array of values args = arguments[1]; l = args.length; for (i = 0; i < l; i++) { result = result.replace(new RegExp("\\^" + i + "\\^"), args[i]) } } else { for (i = 1; (i + 1) < l; i += 2) { result = result.replace(new RegExp("\\^" + arguments[i] + "\\^"), arguments[i + 1]) } } return result; } }; , _ _ Key Generation Error: Missing name or id. : " - - " Parameter Substitution Error: Missing name or index.