global

From DavinciWiki
(Difference between revisions)
Jump to: navigation, search
 
(One intermediate revision by one user not shown)
Line 6: Line 6:
 
Return Value: None.  
 
Return Value: None.  
 
|
 
|
Syntax: global(VAR)
+
[[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.
 
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.

Latest revision as of 10:41, 27 March 2006



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