The material we've covered about arrays is unique, and you may not be sure of how to use this knowledge. In order to put everything you've learned together, we're going to write a storage procedure for your mydatent routine. You just need to learn about one more simple function: $Increment. It takes a variable and increments (changes) its value, and also returns this value. The increment can be a positive or negative number. We're going to use it in its simplest way, with a default increment of 1.
The $Increment function changes the value of its first argument.
SAMPLES>write a WRITE a ^ <UNDEFINED> *a SAMPLES>write $increment(a) 1 SAMPLES>write $increment(a) 2 SAMPLES>write $increment(a,2) 4 SAMPLES>write a 4 SAMPLES>