10:40 30-08-2003
;)
sub get_msg_arr_end()
# returns certain number of messages from the end
{
($num_from_end, $num_msgs, $msg_arr_ptr) = @_;

unless (($NUM_MSG_IN_FL, $LST_MSG_FL, $nm_lst_msg) = &read_inf($infofile))
{
print "coudln't open info file!\n";
return 0;
}

$begid = $nm_lst_msg - $num_from_end;
$endid = $begid - $num_msgs + 1;

# if not all messages were there
print "\$begid = $begid\n";
print "\$endid = $endid\n";

&get_msg_arr($endid, $begid, $msg_arr_ptr);

# no messages retrieved
if(@$msg_arr_ptr == undef)
{
return 0;
}

return 1;
}
Закрыть