Skip to main content

This is documentation for Caché & Ensemble.

For information on converting to InterSystems IRISOpens in a new window, see the InterSystems IRIS Migration Guide and Migrating to InterSystems IRIS, both available on the WRC Distributions pageOpens in a new window (login required).

Increment() Function

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 subroutine for your myBASdatent 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.

Note:

The Increment() function changes the value of its first argument.

println "current value of a = ", a
println "incremented to ", increment(a)
println "incremented to ", increment(a)
println "incremented to ", increment(a,3)
println "decremented to ", increment(a,-2)
println "a = ", a
Copy code to clipboard
FeedbackOpens in a new window