Re: last line blues

Scott Raney (raney@metacard.com)
Tue, 11 Mar 1997 20:00:37 -0700 (MST)

On Tue, 11 Mar 1997, Simon Lord wrote:

> I have an interesting problem whereby I cannot delete the last line of a
> fld. These flds contains text files that were read in and placed into
> fld "a". Fld a is then purged of all empty lines, except that it would
> always delete my last line.
>
> I ran it a few times without removing the empty line and I found that
> there was indeed an empty line there, but when it can to deleteing it it
> would not only delete the last line but the line above it also. This
> line has no space or cr in it that I can see but for some reason I just
> can't delete the last line with losing the second to last as well.
>
> I made a small script that beeps when the user clicks on any line thats
> either empty or has just a space in it. It beeps on every single empty
> line except the last one. AArrggg.

I think this may be a "feature": MetaCard, like HyperCard, ignores the
last return in a container. That is, if you have "x" & return in a
varible y, "put the number of lines in y" returns 1, not 2. If you
want to delete this hanging bit, you have to delete the last *char* of
the field, and not the last line. Something like the following should
do the trick:
if the last char of field "x" is return
then delete last char of field "x"

Regards,
Scott

> Thanks.
> --
> [---------------------------] Simon Lord
> [Important letters that.....] Database Engineer, CAE Electronics
> [contain no errors will.....] tel: (514) 341-2000 x3861
> [develop errors in the mail.] fax: (514) 340-5496
> [---------------------------] email: simonl@cae.ca
>

***************************************************************
Scott Raney raney@metacard.com http://www.metacard.com
Any sufficiently advanced technology
is virtually indistinguishable from magic -- Clark's law