global

From DavinciWiki
Jump to: navigation, search


Description

Bind a variable created in a function to a global variable of the same name

Arguments and Return Values

Arguments: A global or function variable

Return Value: None.

Usage

Syntax: global(variable)

Variables created in a user-defined function are unavailable for manipulation in the global variable space. Utilitizing the global() function imports a global variable into a function. Any alteration of the variable in the function will alter the global variable.

Examples

dv> var
2

dv> define function1() {
 1> global(var)
 1> var = var + 1
 1> printf("var = %d\n",var)
 1> }
Replacing function function1

dv> function1()
var = 3

DavinciWiki Mini-Nav Bar

Contents


Contact Developers

  • davinci-dev [AT] mars.asu.edu

All other topics

  • See navigation on the left


Recent Core Changes

Modified On: 03-27-2006

Personal tools