The two lines that were repeated five times in the previous version now show up with indentation between a for line and its corresponding endfor. The script above is long, but it can be made much shorter with the use of a for-loop: The rest of the script should be known stuff by now. Text$ = Get label of interval: 1, intervalNumberĪppendInfoLine: “Interval ”, intervalNumber, “: ”, text$Ī new trick that you see here is that as a numeric argument ( Interval number, the second argument to Get label of interval.), you can use not only a number (as in all previous examples), but also a variable ( intervalNumber). They only differ in the interval number, and can therefore be made identical by using a variable for the interval number, like this: The first step is to realize that the sentences starting with text$ are similar to each other, and the sentence starting with appendInfoLine are also similar to each other. WriteInfoLine: “The texts in the first five intervals:” With knowledge from the previous sections, you could write it like this: It’s easy to imagine that you actually want the texts of all the first five intervals. Take the example of the previous page, whereas you wanted to know the text in the third interval of the first tier of a selected TextGrid. The power of a procedural programming language is most easily illustrated with the for-loop.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |