I am getting an error stating that an object is expected in the below code.
Declarations...
this.regions = {};
this.regions = ["US", "Europe", "Asia"];
this.regionalRankingKey = ["SP500", "GBE", "CNG"]; //this is the ranking model key for pulling up the rankings object.
this.rankingTypes = ["gainers", "losers", "actives"];
this.regionalRankings = {};
this.rankingWSODIssues = [];
marketSummary_data.prototype.initRankingsNew = function(){
for(var worldRegion in this.regions){
for (var rankType in this.rankingTypes){
//this is the line getting the error.
this.regionalRankings[worldRegion][rankType] = this.getRankings(rankType, this.regionalRankingKey[worldRegion]);
for(var i = 0; i < 5; i++){
this.rankingWSODIssues.push(this.regionalRankings[worldRegion][rankType].value("Result[0].Row[" + i + "].WSODIssue"));
}
}
}
for(var item in this.rankingWSODIssues){
Response.Write("<p>" + item + ": " + rankingWSODIssues[item] + "</p>");
}
}
the function this.getRankings returns an object.
marketSummary_data.prototype.getRankings = function(rankingType, rankingSet){
//ranking types Epctchg+ (pct gainers)
//Epctchg- (pct losers)
//Edollar+ (net gainers)
//Edollar- (net losers)
//Evol+ (highest volume)
//rankingSets
if (rankingType == "gainers"){
rankingType = "Epctchg+";
}
if (rankingType == "losers"){
rankingType = "Epctchg-";
}
if (rankingType == "actives"){
rankingType = "Evol+";
}
var rankings = User.CreateObject("WIT.Rankings.1")
rankings.SetVariableName("Rankings")
rankings.SetInput("Ranking.RT", 0)
rankings.SetInput("Ranking.Type", rankingType)
rankings.SetInput("Ranking.Set", rankingSet)
rankings.SetInput("Ranking.Rows", 5)
rankings.SetInput("Ranking.Symbolset", "BridgeStreet");
rankings.SetInput("Ranking.MinPrice", 0); // only want stocks trading higher> 0
rankings.Retrieve();
return rankings; }
Any ideas on what I am doing wrong here?