On Wed, Feb 28, 2007 at 08:43:12AM -0500, Pierre Girard wrote:
> Kyle Johnson wrote:
> 
>> The problem is that I don't know how to do it, which is why I
>> came here. :)
> 
> If i have the right segment of code, you can make it look like this:
> 
>  $from = substr($from, 0, $CONFIG{'MAX_COL_LEN'}) . "..."
>  if (length($from)>$CONFIG{'MAX_COL_LEN'});
>
>  $subject = substr($subject, 0, $CONFIG{'MAX_COL_LEN'}) . "..."
>  if (length($subject)>$CONFIG{'MAX_COL_LEN'});

I prefer to do this part like this:

  $from = substr($from, 0, $CONFIG{'MAX_COL_LEN'}-3) . "..."
  if (length($from)>$CONFIG{'MAX_COL_LEN'});

  $subject = substr($subject, 0, $CONFIG{'MAX_COL_LEN'}-3) . "..."
  if (length($subject)>$CONFIG{'MAX_COL_LEN'});

This makes it so that the maximum length of the column is actually
$CONFIG{MAX_COL_LEN} characters. It's a minor detail, but if you're
going to bother to fix it, you may as well fix it properly. :)

Reply via email to