Section B.6. Ranges


B.6. Ranges

In HyperTalk, when you want to get a portion of a string or list, you use the keyword to, like this:

character 1 to 10 of "Fried octopus" --Would return "Fried octo"

In AppleScript, however, you achieve the same job with the word through, like this:

characters 1 through 10 of "Fried octopus"

In HyperTalk, you refer the type of information you're getting in the singularcharacter, for example. In AppleScript, you refer to the same type of information in the plural (characters, in this example).



AppleScript. The Missing Manual
AppleScript: The Missing Manual
ISBN: 0596008503
EAN: 2147483647
Year: 2003
Pages: 150

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net