I was wondering what may be causing those undefined values to be in
the qry.data object as it causes problems when mapping codes to other
objects.
Thanks!
Tony Z
function setAppSettings() {
var x;
var obj;
var i = 0;
var qry = new Myna.Query({
dataSource:"ssjs",
sql:"select * from setting"});
if (qry.data.length > 0) {
for (x in qry.data) {
obj = qry.data[x];
i += 1;
Myna.println(i + " " + obj.code);
}
}
}
setAppSettings();
Output:
1 undefined
2 siteTheme
3 undefined
4 appDirectory
5 seoFileExtension
6 seoProductMarker
7 seoPageMarker
8 storeName
9 customerURL
10 secureCustomerURL
11 administratorURL
12 charset
13 cachecontrol
14 expires
15 robots
16 headerLinks
qry.data.forEach(function(obj,i){
i += 1;
Myna.println(i + " " + obj.code);
})
As a bonus, because "obj" and "i" are now local argument variables
there is no need to "var" them at the top of the function.
----------------------------------------------------------
Mark Porter
Myna JavaScript Application Server
Easy web development with server-side JavaScript
http://www.mynajs.org
> --
> You received this message because you are subscribed to the Google Groups "MynaJS-General" group.
> To post to this group, send email to mynajs-...@googlegroups.com.
> To unsubscribe from this group, send email to mynajs-genera...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/mynajs-general?hl=en.
>
>
Tony Zakula