Search Contact information
University of Cambridge Home Department of Engineering
University of Cambridge >  Engineering Department >  computing help
next up previous contents
Next: Debugging Up: Writing your own scripts Previous: Writing your own scripts

Global variables

Ordinarily, each function has its own local variables, which are separate from those of other functions, and from those of the base workspace. However, if several functions, and possibly the base workspace, all declare a particular name as global, then they all share a single copy of that variable. Any assignment to that variable, in any function, is available to all the other functions then declare it as global.

© Cambridge University Engineering Dept
Information provided by Tim Love