Some OpusScript functions include a parameter that requires you to specify a number within an Index, For example: Example 1: |
mySlideshow.Play(2) |
In the example above, the index number (i.e. 2) indicates which slide to play. In the example below, the index number indicates which word to select Example 2: |
var middleName = "String.word("James Henry Smith",2) |
In this example, the variable middleName contains the value Henry i.e. the second word in the string "Jame Henry Smith". So an Index number indicates the value contained at an Index position. There are two methods of indexing |
Zero-based index – the index number starts at 0. This means the first indexed position starts at number 0, the second position is number 1, and so on. Example 1 above uses a zero-based index. Thus, in Example 1, the number 2 indicates the third slide will be played. |
Index starts at 1 – the index number starts at 1. This means the first indexed position starts at number 1, the second position is number 2, and so on. Example 2 above uses an index that starts at 1. Thus in Example 2, the number 2 indicates the second word in the string (i.e. Henry). |
Note: Be careful to remember which method of indexing has been used with the function you want to use. |