Learning Spin: Text-to-Speech
Let's take a look at Text-to-Speech & show you an example of how objects can be used. My other tutorials (including my written objects guide) are here.
You can also download it here.
Building on previous tutorials, there are a few new concepts;
When you declare a method (), you can use a pipe (the key above the backslash on your keyboard) and declare local variables. Here, I've declared just one, 'i'. You can declare multiple with a comma between each; PUB start | i,x,z. Local variables are only available within the method (other methods can't access them), and are re-initialized each time the method is called. They're often used for controlling incrementing loops and other throwaway type activities.
Symbol Address (@)
The @ sign return the address the variable is stored instead of the value.