re-Ordering sub stacks

Thomas McGrath III mcgrath3 at mac.com
Wed Nov 19 12:19:17 EST 2008


Chris,

This might be a better approach for the repeat loop I mentioned in the  
previous email. Use the lineoffset instead:
on mouseUp
   set the hilite of me to true
   put mainstacks() into listOfMainStacks
   put line (lineoffset("ddm-",listOfMainStacks)) of listOfMainStacks  
into thismainStack
   set the cursor to busy
   lock screen
   orderSubs thismainStack
     set the hilite of me to false
   beep
   answer "Done!"
   set the cursor to arrow
   set the hilite of me to false
end mouseUp

on orderSubs thismainStack
    get the substacks of stack thismainStack
    sort it
    put it into theSubstacks
    repeat with x = 1 to the number of lines of theSubstacks
       put line x of theSubstacks into theStack
       set the mainstack of stack theStack to thismainStack
    end repeat
    save stack thismainStack
end orderSubs


Tom McGrath III
Lazy River Software
3mcgrath at comcast.net

iTunes Library Suite - libITS
Information and download can be found on this page:
http://www.lazyriversoftware.com/RevOne.html

>
> On Nov 19, 2008, at 11:36 AM, Chris Condit wrote:
>> button script:
>>
>> --re-order substacks
>> on mouseUp
>> set the hilite of me to true
>> put mainstacks() into listOfMainStacks
>> put the num of lines in listOfMainStacks into numToDo
>> repeat with x = 1 to numToDo
>>   if char 1 to 4 of line x of listOfMainStacks = "ddm-" then
>>     put line x of listOfMainStacks into thismainStack
>>     exit repeat
>>   end if
>> end repeat
>> set the cursor to busy
>> lock Screen
>> orderSubs thismainStack
>>   set the hilite of me to false
>> beep
>> answer "Done!"
>> set the cursor to arrow
>> set the hilite of me to false
>> end mouseUp
>>
>> on orderSubs thismainStack
>> 	get the substacks of stack thismainStack
>> 	sort it
>> 	set the substacks of stack thismainStack to it
>> 	save stack thismainStack
>> end orderSubs










More information about the use-livecode mailing list