MOO-cows Mailing List Archive

[Prev][Next][Index][Thread]

Re: Network output buffer



At 20:35 1/4/96, ThwartedEfforts wrote:
>At 11:14 AM 1/4/96 PST, you wrote:
>> for Line in (htext)
>>   notify(player, Line, 1);
>>   if ($command_utils:running_out_of_time())
>>     suspend(0);
>>   endif
>> endfor
>> suspend(1);
>> boot_player(player);
>
>First off, you are dropping the return value of notify() on the floor
>instead of using it:
>
>for Line in (htext)
>  while (!notify(player, Line, 1))
>    suspend(1);
>  endwhile
>  $command_utils:suspend_if_needed(0);
>endfor
>

Actually....

for Line in (htext)
  while (notify(player, Line, 1) == 0)
     suspend(1);
  endwhile
$command_utils:suspend_if_needed(0);
endfor

Should avoid infinite loops if typeof(Line) != STR

Just my $0.02

Janus

---
"640K ought to be enough for anybody."
    -- Bill Gates, 1981





Home | Subject Index | Thread Index