jed-users mailing list

[2004 Date Index] [2004 Thread Index] [Other years]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]

Re: jed 0.99-17 looks good


> 
> Paul Boekholt <p.boekholt@xxxxxxxxx> wrote:
> >     return integer(a[np]);
> >
> >on or near line 185.  Apparently this would give a 0 in slang 1, but gives an
> >error in slang 2 when a[np] is not an integer.

On Thu, 25 Nov 2004 13:13:33 -0500, "John E. Davis" <davis@xxxxxxxxxxxxx> said:
> 
> The slang2 way of handling this would be to use:
> 
>    try
>      return integer (a[np]);
>    catch ParseError: 
>      return 0;

Meanwhile the code
   variable files = listdir(folder);
   if (length(files))
     {
	% Other MH mail readers keep a list of marked files in
	% .mh_sequences, so message numbers should ascend.
	files = array_map(Integer_Type, &integer, files);
	n = string(1 + array_max(files));
     }

in my rmail.sl is suddenly giving me the error 

 Error encountered while executing integer

Hmmm, now it's gone.  Some testing reveals that when the string that is
not an integer begins with [a-f] it gives the error

 Only digits may appear in an octal or decimal number

and when it begins with some other letter, it sometimes works (returning 0)
and sometimes gives the error

 Error encountered while executing integer

This raises two questions:
-is something wrong with integer()?
-how do I catch an error in an array_map?

--------------------------
To unsubscribe send email to <jed-users-request@xxxxxxxxxxx> with
the word "unsubscribe" in the message body.
Need help? Email <jed-users-owner@xxxxxxxxxxx>.


[2004 date index] [2004 thread index]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]