Hello [EMAIL PROTECTED]!

On 15-Feb-00, you wrote:

 T>    d1:  second (to-block first blk) 

It seems like the problem is in this line. The result of FIRST BLK
will be a string (since BLK is a block of strings); then you are
converting it to a block with TO-BLOCK. Now look here:

>> to-block "something inside the string"
== [something inside the string]
>> to-block "   "
== []

When FIRST BLOCK returns an empty string (or a string with just
spaces) you get an empty block as result. So when you try to
access the second element you get an error:

>> second []
** Script Error: Out of range or past end.
** Where: second []

As you said, the error happens when your file ends with an empty
line. You can solve the problem with:

   d1: to-block first blk
   if empty? d1 [break] ; exit from the loop
   d1: second d1
   ; etc.

Regards,
    Gabriele.
-- 
o--------------------) .-^-. (----------------------------------o
| Gabriele Santilli / /_/_\_\ \ Amiga Group Italia --- L'Aquila |
| GIESSE on IRC     \ \-\_/-/ /  http://www.amyresource.it/AGI/ |
o--------------------) `-v-' (----------------------------------o

Reply via email to