Remove CRLF

Michael Young meyoung at bresnan.net
Mon Jun 20 10:11:15 EDT 2005


Jon, Robert offline (I think), Xavier, Mark Smith and others helped me 
figure out the issue. Thanks to everyone for their input.

I could truly see that %Od, otherwise known as <CR>, was the offending 
code left behind when I tried to strip off the CRLF after adding the 
CRLF myself. I had one prototype stack with one card on OS X in which I 
entered the data and processed the data. So, the issue is 
cross-platform but I myself stayed on one platform, one mainstack, and 
one card.

The problem should have been a lot simpler to solve. For example in 
National Instrument's ( http://www.ni.com/ ) LabVIEW 10 years ago when 
I used their line ending codes rather than ASCII codes 10 and 13, etc. 
the line ending issue was handled behind the scenes and just worked. I 
also did not have CPU endian issues in LabVIEW because data was put to 
disk and internally handled in Motorola endian format even if LabVIEW 
was running in Windows on Intel hardware. LabVIEW did the heavy lifting 
for me.

I learned that just using LF rather than CRLF gave me the cosmetic 
effect that I wanted and the LF stripped off automagically as people 
are want to say.

I do not understand why such a simple problem had to be so tricky in RR.

I have filed a bug report. 
http://support.runrev.com/bugdatabase/show_bug.cgi?id=2918

Michael
PS This simple problem was part of my attempt (that ultimately 
succeeded, yeah) to recreate the demo REALbasic 2005 tutorial example 
that of course truly just worked simply. Sigh.

On Jun 19, 2005, at 10:08 PM, use-revolution-request at lists.runrev.com 
wrote:

> Michael:
>
> Any chance this is a cross-platform problem?  Could the file you are
> processing have come from another platform?  The end-of-line character
> sequences are different between some platforms: some have two chars
> (<CR> <LF>) while others have just one (<LF> I think).  If you are
> processing a <CR><LF> file on a <LF> system, maybe the code would just
> remove the <LF> (correct for your system), leaving the offending <CR>
>
> Just a theory...
>
> :)
>
> Jon
>
>
>
> Michael Young wrote:
>
>> Mark,
>>
>> Correct. It does not work. I still get the same trailing garbage that
>> is apparently part of the CRLF that I added myself. The garbage is
>> %0d, which I think is 13 when converted from hexadecimal to decimal,
>> meaning that CR is sticking around for some reason.
>>
>> Michael
>>
>>>
>>> Not sure if I fully understand what you're trying to do, but does
>>> 'replace CRLF with empty in <chunk>' really not work?
>>>
>>> Mark
>>>
>>> On 19 Jun 2005, at 16:35, Michael Young wrote:
>>>
>>>> Thanks for the suggestions for all who responded, but I have not had
>>>> success yet.
>>>>
>>>> I noticed an interesting subtlety that is of course NOT full 
>>>> explained
>>>> in the documentation.
>>>>
>>>> 1. Reference Documentation for Object using Filter with: does not 
>>>> show
>>>> item hilitedText. It does show selectedText function entry with
>>>> apparently second line alternate name hilitedText.
>>>>
>>>> 2. Reference Documentation for Dictionary using Filter with with: 
>>>> does
>>>> show both hilitedText and selectedText entries.  The problem is the
>>>> hilitedText entry is the exact same as the selectedText entry.
>>>>
>>>> 3. hilitedText is not in the selectedText function See also: section
>>>> presumably because they are considered one and the same.
>>>>
>>>> 4. line x suggestion also has the CRLF still present. It made no
>>>> difference whether list behavior was true or false.
>>>>
>>>> I still haven't figured out how to get rid of the CRLF that I added.
>>>> Very frustrating.
>>>>
>>>> Michael
>>>>
>>>> On Jun 19, 2005, at 2:32 AM, use-revolution-request at lists.runrev.com
>>>> wrote:
>>>>
>>>>>
>>>>> Michael
>>>>>
>>>>> There's different ways to get a line...
>>>>>
>>>>> get line x of field f will give you the line selected without the
>>>>> crlf.
>>>>> or
>>>>> get the selectedtext of fld f -- if the list is not listbehavior
>>>>> or
>>>>> get the hilitedtext of fld f -- if the list is listbehavior
>>>>>
>>>>> Normally, you just need to add cr, not crlf - as far as i know, rev
>>>>> takes
>>>>> care of the right line delimiter in displays.
>>>>>
>>>>> cheers
>>>>> Xavier
>>>>>
>>>>>>
>>>>>> Hello,
>>>>>>
>>>>>> I have added CRLF to end of lines in a Scrolling Field for
>>>>>> cosmetic effect. Now I want to strip off the CRLF for a user
>>>>>> selected line (although the last line in the Scrolling Field
>>>>>> will not have CRLF).
>>>>>> What is the simplest way to strip off the CRLF, if present? I
>>>>>> have not been able to stumble on the answer or find it in
>>>>>> documentation or list archives. Oh well. I am sure the
>>>>>> solution is simple.
>>>>>>
>>>>>> Thanks,
>>>>>>
>>>>>> Michael
>>>>>> OS X 10.3.9
>>>>>> RR 2.6



More information about the use-livecode mailing list