Message 1 of 2
while loop
Not applicable
11-19-2002
01:57 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I am trying to get a while loop to cycle through
all the attributes
all the attributes
My loop never advances and I can't figure out how
to get ent=nextone
to get ent=nextone
I have this
while
(acdbEntNext(ent,nextone))//cycle through all
attributes
{
//rc=acdbEntNext(ent,nextone);//get
the next entity
rbTrav=acdbEntGet(nextone);//set that as
our target
if(!rbTrav)//if I don't get the target
quit
{acutPrintf("\nFailed to get target entities
data. ");return;}
while(rbTrav)//go
through the result
buffer
{
switch(rbTrav->restype)
{
case
0://insert or attribute tag
string
strcpy(lyrName,
rbTrav->resval.rstring);
strcat(lyrName,
"--0");
RetVal=MessageBox(NULL,lyrName ,
"entity info
",MB_OK);
break;
case
8://layer name
strcpy(lyrName,
rbTrav->resval.rstring);
strcat(lyrName,
"--8");
RetVal=MessageBox(NULL,lyrName ,
"entity info
",MB_OK);
break;
case
2://block name
strcpy(lyrName,
rbTrav->resval.rstring);
strcat(lyrName,
"--2");
RetVal=MessageBox(NULL,lyrName ,
"entity info
",MB_OK);
break;
case
100:
strcpy(lyrName,
rbTrav->resval.rstring);
strcat(lyrName,
"--100");
RetVal=MessageBox(NULL,lyrName ,
"entity info
",MB_OK);
break;
case
5://handle
strcpy(lyrName,
rbTrav->resval.rstring);
strcat(lyrName,
"--5");
RetVal=MessageBox(NULL,lyrName ,
"entity info
",MB_OK);
break;
case
1://attribute textstring when using
entnext
strcpy(lyrName,
rbTrav->resval.rstring);
strcat(lyrName,
"--1");
RetVal=MessageBox(NULL,lyrName ,
"entity info
",MB_OK);
break;
}//switch
statement
rbTrav=rbTrav->rbnext;//next item in
result buffer
//*******right here I need
to set ent=nextone but that give me an
error.***************
}//while
loop
(acdbEntNext(ent,nextone))//cycle through all
attributes
{
//rc=acdbEntNext(ent,nextone);//get
the next entity
rbTrav=acdbEntGet(nextone);//set that as
our target
if(!rbTrav)//if I don't get the target
quit
{acutPrintf("\nFailed to get target entities
data. ");return;}
while(rbTrav)//go
through the result
buffer
{
switch(rbTrav->restype)
{
case
0://insert or attribute tag
string
strcpy(lyrName,
rbTrav->resval.rstring);
strcat(lyrName,
"--0");
RetVal=MessageBox(NULL,lyrName ,
"entity info
",MB_OK);
break;
case
8://layer name
strcpy(lyrName,
rbTrav->resval.rstring);
strcat(lyrName,
"--8");
RetVal=MessageBox(NULL,lyrName ,
"entity info
",MB_OK);
break;
case
2://block name
strcpy(lyrName,
rbTrav->resval.rstring);
strcat(lyrName,
"--2");
RetVal=MessageBox(NULL,lyrName ,
"entity info
",MB_OK);
break;
case
100:
strcpy(lyrName,
rbTrav->resval.rstring);
strcat(lyrName,
"--100");
RetVal=MessageBox(NULL,lyrName ,
"entity info
",MB_OK);
break;
case
5://handle
strcpy(lyrName,
rbTrav->resval.rstring);
strcat(lyrName,
"--5");
RetVal=MessageBox(NULL,lyrName ,
"entity info
",MB_OK);
break;
case
1://attribute textstring when using
entnext
strcpy(lyrName,
rbTrav->resval.rstring);
strcat(lyrName,
"--1");
RetVal=MessageBox(NULL,lyrName ,
"entity info
",MB_OK);
break;
}//switch
statement
rbTrav=rbTrav->rbnext;//next item in
result buffer
//*******right here I need
to set ent=nextone but that give me an
error.***************
}//while
loop