Clearing spaces from lines of a field

David Squance squance at elkvalley.net
Thu Jan 15 00:01:45 EST 2004


>On 1/14/04 9:01 PM, David Squance wrote:
>
>> In the process of trying to build a "cleaning script" I tried the following:
>> Type a few short lines (with returns) in a field.  After line 1 add a few
>> spaces.  Clicking in the empty space to the right of the visible characters
>> leaves the cursor the expected distance from the last visible letter.
>> Using the delete key removes the spaces as expected and similar clicking
>> leaves the cursor beside the last letter.  However:
>>
>> In the multiple line message box, I put:
>>
>> repeat
>>     if last char of line 1 of fld "theField" is " " then
>>     delete last char of line 1 of fld "theField"
>>     else exit repeat
>>  end repeat
>> put line 1 of fld "theField"&"<"
>>
>> which produces:
>>
>> the text<
>>
>> Then in the single line message box, I put:
>>
>> put ">"&( line 1 of fld "theField")&"<"
>>
>> which produces:
>>
>>
>>>the text    <
>>
>>
>> I went back and forth a few times, and it made no difference.  I can still
>> click beside the line of text and have the cursor stay out the distance of
>> the added spaces.  Any clues as to what is going on?
>
>I followed the recipe, but I can't reproduce it. I always get ">the
>text<" regardless of which message box view I use.

And are the spaces gone in the actual field, too?

I found this originally in a project, and wondered if it was something
peculiar to the fields there, but it was the same in a brand new stack and
field.  [OS 10.3.2, RR 2.1.2]
Dave




More information about the use-livecode mailing list