Hint for Repeating a single value

Repeat controls are great - but they MUST return an array, even if it is just one entry.

In my example, I used a repeat control to display entries from a dblookup. However, some of my lookups only returned one entry, so the result was a string, not an array. Since the result of my dblookup was a string, the repeat control would not display the one returned result.

The solution is to convert the result to a string first by using valueOf(). This returns a string delimited by commas. Then split the result by the commas to get an array. If split fails, then the result was an array to start with.

var tmpstr = result.valueOf();

try {

var newarr = tmpstr.split(“,”);

return(newarr)

}

catch(err){

return(tmpstr);

}

fyi