If you dont like the "mess" in the 'main' function, how about this...
Code:
#define I_AM_DEAD	(1<<30)   //unused entity flag bit

void runWhileEntity(ENTITY* inLight)
{
	while(!is(inLight, I_AM_DEAD))
	{
		inLight.x += time_step;
		my_temp[0] = inLight.x;
		wait(1);
	}
	ent_remove(inLight);
	beep();
	beep();
	beep();
}

void main()
{
	set(deb_pan,SHOW);
	level_load(NULL);
	wait(3);
	
	ENTITY* theEnt;
	theEnt = ent_create(NULL,nullvector,NULL);

	runWhileEntity(theEnt);
	while(key_t == OFF) wait(1);
	set(inLight, I_AM_DEAD);
}



Or if its the "new" flag I_AM_WHATEVER that you dont like,
you could utilise one of the now almost-unused C-script FLAG1->FLAG8 flags.


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial