- UID
- 184885
- 积分
- 64
- 精华
- 贡献
-
- 威望
-
- 活跃度
-
- D豆
-
- 在线时间
- 小时
- 注册时间
- 2004-10-19
- 最后登录
- 1970-1-1
|
发表于 2007-12-3 19:03:28
|
显示全部楼层
samples\database\xrecord_dg中有读取resbuf 值的例子。
if (pRb != NULL)
printList(pRb );
void
printList(struct resbuf* pBuf)
{
int rt, i;
char buf[133];
for (i = 0;pBuf != NULL;i++, pBuf = pBuf->rbnext) {
if (pBuf->restype < 0)
// Entity name (or other sentinel)
rt = pBuf->restype;
else if (pBuf->restype < 10)
rt = RTSTR;
else if (pBuf->restype < 38)
rt = RT3DPOINT;
else if (pBuf->restype < 60)
rt = RTREAL;
else if (pBuf->restype < 80)
rt = RTSHORT;
else if (pBuf->restype < 100)
rt = RTLONG;
else if (pBuf->restype < 106)
rt = RTSTR;
else if (pBuf->restype < 148)
rt = RTREAL;
else if (pBuf->restype < 290)
rt = RTSHORT;
else if (pBuf->restype < 330)
rt = RTSTR;
else if (pBuf->restype < 370)
rt = RTENAME;
else if (pBuf->restype < 999)
rt = RT3DPOINT;
else // pBuf->restype is already RTSHORT, RTSTR,
rt = pBuf->restype; // etc. or it is unknown.
switch (rt) {
case RTSHORT:
if (pBuf->restype == RTSHORT)
acutPrintf(
"RTSHORT : %d\n", pBuf->resval.rint);
else
acutPrintf("(%d . %d)\n", pBuf->restype,
pBuf->resval.rint);
break;
case RTREAL:
if (pBuf->restype == RTREAL)
acutPrintf(
"RTREAL : %0.3f\n", pBuf->resval.rreal);
else
acutPrintf("(%d . %0.3f)\n",
pBuf->restype, pBuf->resval.rreal);
break;
case RTSTR:
if (pBuf->restype == RTSTR)
acutPrintf(
"RTSTR : %s\n", pBuf->resval.rstring);
else
acutPrintf("(%d . \"%s\")\n",
pBuf->restype, pBuf->resval.rstring);
break;
case RT3DPOINT:
if (pBuf->restype == RT3DPOINT)
acutPrintf(
"RT3DPOINT : %0.3f, %0.3f, %0.3f\n",
pBuf->resval.rpoint[X],
pBuf->resval.rpoint[Y],
pBuf->resval.rpoint[Z]);
else
acutPrintf("(%d %0.3f %0.3f %0.3f)\n",
pBuf->restype,
pBuf->resval.rpoint[X],
pBuf->resval.rpoint[Y],
pBuf->resval.rpoint[Z]);
break;
case RTLONG:
acutPrintf("RTLONG : %dl\n", pBuf->resval.rlong);
break;
case -1:
case RTENAME: // First block entity
acutPrintf("(%d . <Entity name: %8lx>)\n",
pBuf->restype, pBuf->resval.rlname[0]);
break;
case -3: // marks start of xdata
acutPrintf("(-3)\n");
}
if ((i == 23) && (pBuf->rbnext != NULL)) {
i = 0;
acedGetString(0,
"Press <ENTER> to continue...", buf);
}
}
return;
} |
|