function Scatter( o ) { var result = {}; var bEmpty = true; var vba = {}; if ( o.RecordCount > 0 ) { bEmpty = false; vba = new VBArray( o.GetRows() ); } var fldCount = o.Fields.Count; for (var i = 0; i < fldCount; i++ ) { result[o.Fields(i).Name] = []; if ( ! bEmpty ) { for ( var j = vba.lbound(2); j <= vba.ubound(2); j++ ) { result[o.Fields(i).Name].push( vba.getItem(i,j) ); } } } return result; }
© Copyright Bruce M. Axtens, 2012
No comments:
Post a Comment