|
试下这样操作,参考下!
action
{
double wait_time;
long secInYear;
char *mrsCollins;
long t;
int i, loops = 3;
wait_time=lr_get_attrib_double("time");
secInYear = lr_get_attrib_long ("secondsInYear");
mrsCollins =lr_get_attrib_string ("MrsCollins");
if ( wait_time <= 0 ){
lr_message("Illegal time value = %f \n", wait_time);
return;
}else
{
lr_message("Wait time value = %f", wait_time);
lr_message("The number of seconds in a year is %ld",
secInYear);
lr_message("Mr. Collins' wife is named %s Lucas",
mrsCollins);
}
for (i=0; i < loops; ++i) {
time(&t);
lr_message("Time and date: %s", ctime(&t));
lr_think_time(wait_time);
}
time(&t);
lr_message("time and date: %s", ctime(&t));}
return 0;
} |
|