Edit question (was Re: string manipulation question)

Kenneth Brody kenbrody at bestweb.net
Sun Dec 12 16:34:22 PST 2004


Tony Ryder wrote:
[...]
>     Why does the first edit (the one that expands the single quotes) need
>     to have trailing spaces removed, while many of the edits in the global
>     table do not, even though they add characters to the output?
> 
> Is it because the edit controls the whole entry of the field.

I'm not sure what you mean.  Don't all edits "control the while entry
of the field"?

Why do the edits in the global edits table, such as "monexp":

monexp   monexp1 | monexp2 | monexp3
monexp1  "Jan"<uary> | "Feb"<ruary> | "Mar"<ch> | "Apr"<il> | "May" | "Jun"<e>
monexp2  "Jul"<y> | "Aug"<ust> | "Sep"<tember> | "Oct"<ober> | "Nov"<ember>
monexp3  "Dec"<ember>

expand the incoming data, without stripping trailing spaces, while the
edit I wrote to expand a single quote into two single quotes:

  { {!" "!}@ | "'"<"'"> | * }

will fail if you remove the "strip trailing spaces" -- {!" "!}@ -- part?

Mark already showed the reason for the failure:

> Field Length: 20 (pipe shows position right after end of the field)
> 
> that's all folks    |
> that''s all folks    |  (overflow of 1)
> 
> Okay, so if you don't do a trim of the spaces, any trailing space might
> overflow the field length, thus failing the edit?

So, the question is "why does this fail, while the others will not?"  After
all, shouldn't monexp fail the same way?

    Jan      |
becomes
    January      |

Obviously, it doesn't fail that way.  Why does the "expand single quotes"
edit fail this way, while all the others in the global edits table do not?

I can't imagine that Mark and Tony are the only ones interested in this.
I'll post the answer at the end of tomorrow (Monday) if no one figures it
out before then.

-- 
+-------------------------+--------------------+-----------------------------+
| Kenneth J. Brody        | www.hvcomputer.com |                             |
| kenbrody/at\spamcop.net | www.fptech.com     | #include <std_disclaimer.h> |
+-------------------------+--------------------+-----------------------------+
Don't e-mail me at: <mailto:ThisIsASpamTrap at gmail.com>


More information about the Filepro-list mailing list