func Init() sys.add_var('col', 'string') this.setfield('i', 'i' + this.id) if(linked('Text')) sys.add_var('txt', 'string') end end func doEnum(_data) fvar(id) id = d("rsHandle") if(linked('Text')) blk.println(this.txt, ' = "";' ) end if(linked('onColumns')) blk.println(this.col + ' = "";') blk.println('for(int ' + this.i + ' = 0; ' + this.i + ' < ', id, '.FieldCount; ' + this.i + '++) {').inc() blk.println(this.col, ' += ', id, '.GetName(', this.i, ') + ', d('Delimiter'), ';') blk.dec().println('}') event('onColumns', this.col) end blk.println('while(' + id + '.Read()) {').inc() blk.println(this.col + ' = "";') blk.println('for(int ' + this.i + ' = 0; ' + this.i + ' < ', id, '.FieldCount; ' + this.i + '++) {').inc() blk.println(this.col, ' += ', id, '.GetValue(', this.i, ').ToString() + ', d('Delimiter'), ';') blk.dec().println('}') if(linked('Text')) blk.println(this.txt, ' += ', this.col, ' + Environment.NewLine;') end if(linked('onResult')) event('onResult', this.col) end blk.dec().println('}') end func Text() return(this.txt) end