string manipulation question

Kenneth Brody kenbrody at bestweb.net
Sat Dec 11 08:04:56 PST 2004


Fairlight wrote:
[...]
> > > >     { {!" "!}@ | "'"<"'"> | * }
[...]
> > Question to ponder:
> >
> >     Why does the edit fail if the data has any single quotes, and you don't
> >     strip trailing spaces?
> 
> SWAG here--only thing I can think of:
> 
> 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?

Correct.  (However, see below.)

> IF this is a correct surmisal (and I'm -not- at all sure it is--it's the
> only thing I could think of), then might I ask what happens in the
> following case?
> 
> abcdefghijk'lmnopqrs|
> abcdefghijk''lmnopqrs|
> 
> Will the edit fail, or will the 's' be chopped?

"What happened when you tried it?"  :-)

Yes, it too will fail.


Second question to ponder:

Given this edit:

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>

Why does this not fail, even though we are not stripping trailing spaces?

-- 
+-------------------------+--------------------+-----------------------------+
| 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