text in fields (CR/LF, CR, LF) which is correct?

Richard Gaskin ambassador at fourthworld.com
Fri Aug 30 13:07:01 EDT 2002


J. Landman Gay wrote:

> Dar Scott <dsc at swcp.com> wrote:
> 
>> However, I've seen examples from old timers on the list that
>> include return quite a bit.  I find that jarring and sometimes
>> confusing.  Yet, others might find it quite natural.
> 
> It's a holdover from HyperCard and SuperCard, where "return" has been in
> use since the beginning. As you say, it's very natural for anyone coming
> from another xtalk environment. The synonym "cr" is what others probably
> want to use, it's the same thing.
> 
> I'm not convinced we need a new constant though, but of course I could
> easily be missing something. I have always just used "cr" or "return"
> (interchangeably) and line endings have always been converted correctly
> no matter what platform I move my stack to. Never had any problems with
> it. If hard binary data needs to be converted, as in the case we've been
> discussing, then I just replace the appropriate ascii characters with
> "cr" or "return" and it fixes things.

With one issue:  it is perfectly reasonable to expect an intelligent person
to attempt to use "cr" or "return" in cases where they realy need a _real_
return (numtochar(13)).

This disparity between the Mac-authoring-tool convention and the
UNIX-favoring MC engine presents a learnability problem for anyone who
hasn't yet learned that the "return" constant does not denote a return
character. :)

In looking for ways to solve the problem, we have to ask ourselves:  should
we give real and true values to constants for the benefit of all future
users, or do we keep answering this question ad infinitum in order to
preserve compatibility with 10 years' of legacy code.  Not an easy call to
make.

As has been done in other cases where new behavior may require substantial
revisio to legacy code, we could consider a global property, something like
the useOldStyleConstants, so we can retain compatibility by adding only one
line of code.

-- 
 Richard Gaskin 
 Fourth World Media Corporation
 Custom Software and Web Development for All Major Platforms
 Developer of WebMerge 2.0: Publish any database on any site
 ___________________________________________________________
 Ambassador at FourthWorld.com       http://www.FourthWorld.com
 Tel: 323-225-3717                       AIM: FourthWorldInc




More information about the use-livecode mailing list