Hey! I'm currently trying to load values that i set in some entities with 3DWS. A sample of one limb name is this:
Quote: "Classname=turn
up=1
left=1
right=1
down=0
objecttype=entity"
i want to get the middle 4 variables values (up,left,right,down). So i'm using this code:
static int foundCount = 0;
std::string temper;
std::string temp;
temp = dbChecklistString ( i );
char * result;
if( temp.find ( "turn" ) )
{
// if it finds a limb with turn in its classname
result = strtok ( ( char * )temp.c_str ( ), "\n" );
while ( result != NULL )
{
// loops through all of the lines for each limb
temper = result;
if ( temper.find ( "up" ) )
{
turns[foundCount].up = atoi ( temper.substr ( temper.find ( "=" ) + 1, temper.size() ).c_str ( ) );
dbText(400,400,(char *)temper.substr(temper.find("=")+1,temper.size()).c_str());
dbSync();
dbWaitKey();
}
else
if ( temper.find ( "left" ) )
{
turns[foundCount].left = atoi ( temper.substr ( temper.find ( "=" ) + 1, 1 ).c_str ( ) );
}
else
if ( temper.find ( "right" ) )
{
turns[foundCount].right = atoi( temper.substr ( temper.find ( "=" ) + 1, 1 ).c_str ( ) );
}
else
if ( temper.find ( "down" ) )
{
turns[foundCount].down = atoi ( temper.substr ( temper.find ( "=" ) + 1, 1 ).c_str ( ) );
}
result = strtok ( NULL, "\n" );
}
foundCount++;
}
but when i do this up returns everything but the up values and left returns the up values and down and right return nothing. (the extra 3 lines of code in the up structure is what i'm using for the return value) So why do you think this is happening?
I'm poetry in motion