repeat with times

andrew at midwestcoastmedia.com andrew at midwestcoastmedia.com
Tue May 21 14:24:20 EDT 2019


I'm excited to try some of the new features of LC 9.5 but found a  
regression that has me dead in the water. Went to file a bug report,  
but 9.0.5 is the newest version listed. (I realize the team is busy in  
San Jose this week)

Now that I'm a slightly more seasoned coder I know there are more  
efficient ways to accomplish this, but my n00b syntax was very  
English-like for repeat loops like this...

put the number of lines of tSomeText into tThisMany
repeat with x = 1 to tThisMany times
    ## some code
end repeat

The only structure that seems to support "times" now is...

put the number of lines of tSomeText into tThisMany
repeat tThisMany times
   ## some code
end repeat

I make extensive use of what (I now know since I've researched the  
bug) was an exception that let my sloppy code work in the first place.  
This has worked in every version of LC I've used since learning in  
v6.x but now throws a "repeat: bad termination" error in 9.5dp1. While  
the dictionary doesn't explicitly says that "times" should work in  
this type of repeat structure, it just always has (and makes it  
slightly easier to read). I'm happy to accept the deprecation and  
refactor my code if there is a reason for the engine change, but  
wanted to check here before going through that effort.

--Andrew Bell






More information about the Use-livecode mailing list