查看单个帖子
旧 2009-05-07, 03:34 PM   #1
yang686526
高级会员
 
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
yang686526 向着好的方向发展
默认 【转帖】selecting Inserts By Name

selecting inserts by name
selecting inserts by name
using the latest version of the libraries (and version 2.2), this code works fine
odstring inserttype("insert");
odresbufptr rb = odresbuf::newrb(0, inserttype);
oddbselectionsetptr psset = oddbselectionset::select(pdb, rb);
odstring s;
int count = psset->numentities();
s.format(dd_t("%d block inserts"), count);
but this code fails with an exception:
odstring inserttype("insert");
odstring blockname ("hydrant");
odresbufptr rb = odresbuf::newrb(0, inserttype);
rb->setnext(odresbuf::newrb(2, blockname));
oddbselectionsetptr psset = oddbselectionset::select(pdb, rb);
odstring s;
int count = psset->numentities();
s.format(dd_t("%d block inserts with name hydrant"), count);
is there a way i can select by block name?
thanks.
most probably the exception's description (oderror::description()) says that odbagfiler drx is missing.
if this module presents than the code you provided works.
sergey slezkin
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)