Sort Command in 3.5 is adding lines to a variable

Timothy Bleiler bleiler at buffalo.edu
Thu Jul 2 15:47:53 EDT 2009


Thanks Alex.
There are a lot of ways to work around the problems caused by this.

However, my main concern though is with the inconsistency in the  
engine regarding the cr in the variable. The engine is inconsistent in  
its definition of a line for these two lines of code:

sort the lines of tTemp
put the number of lines in tTemp

Sort should never result in changes to the number of lines reported by  
the engine.

Paul,
I think I've seen that too in the earlier versions when there is a  
char on the line after the cr. In that case, the sort command in the  
simple form moves the empty line to the beginning of the variable. The  
difference between 3.5 and earlier versions that I've seen now is that  
a cr with nothing after it is moved to the beginning of the variable,  
effectively creating a new line. In earlier versions a cr at the end  
of a variable was left at the end of the variable by the sort command.

Tim

On Jul 2, 2009, at 3:10 PM, Paul Looney wrote:

> I have had the opposite happen.
> On a large variable, sorting removed lines.
> Rev 3.0, OS X 10.5
> Paul Looney
>
>
> On Jul 2, 2009, at 11:24 AM, Timothy Bleiler wrote:
>
>> Hi,
>>
>> The sort command in 3.5 seems to be adding lines to a variable. I  
>> have a lot of old code that creates lists using a method like this  
>> and I don't believe the problem occurs in earlier versions of rev.
>>
>> Is this a reported bug or am I missing something?
>>
>> To see the error, create a stack with a button, paste the following  
>> code into the button and click on the button.
>>
>> On MouseUp
>> Put "Dog" & cr & \
>>      "Cat" & cr into tTemp
>>  Put number of lines in tTemp into tPreSortCount
>>  sort tTemp
>>  Put number of lines in tTemp into tPostSortCount
>>  Put "Pre-Sort, variable tTemp has" && tPreSortCount && "lines."&  
>> return &\
>>  "Post-Sort, variable tTemp has" && tPostSortCount && "lines."
>> End MouseUp
>>
>>
>> Tim Bleiler, Ph.D.
>> Instructional Designer, HSIT
>> University at Buffalo
>> Phone: 716-829-3867
>>
>> _______________________________________________
>> use-revolution mailing list
>> use-revolution at lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your  
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-revolution
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your  
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
>




More information about the use-livecode mailing list