if there is no wait in your myfunc-function, there is no Usage for the Wait_for.
My English is to bad to explain it

Click to reveal..

A test Code showing the behaviour of wait
Code:
function fuu()
{
	printf("2 in fuu");
	wait(1);
	printf("3 in fuu after wait");
}
function main()
{
	level_load("");
	
	printf("1 before fuu");
	fuu();
	printf("4 after fuu");
}


The output with wait is
Code:
1 before fuu
2 in fuu
4 after fuu
3 in fuu after wait


The output if wait is commented out
Code:
1 before fuu
2 in fuu
3 in fuu after wait
4 after fuu




The solution of Mr.Guest to make it recursive is very bad.
Using an recursive solution for an endless loop fills the stack fast resulting that the program/system crashes

Code:
main() {
     myent=ent_create(...);
     myent.event=whatever;
}

void whatever() {
  while(1) {
     myfunc();
     wait(1);
  }
}

void myfunc() {
  do some writes into the file
  using no wait
}


this will be OK if you don't use a wait in myfunc

EDIT:
Why do you start an endless lopp inside an event??
Each call of the event results to one more endless loop

muffel

Last edited by muffel; 09/04/10 14:50.