Purpose:Define variables that are local to a library function or to a batch file.

 

Format:LOCAL var1, var2, ...

 

Usage:

 

LOCAL will save the existing values of the specified environment variables (if any) and then delete the variable from the environment. You can then SET a new variable with that name; when the library function or batch file exits, the local variables are deleted from the environment and the previous values (if any) are restored.

 

LOCAL allows you to use variables in your library functions without worrying about whether they are also used in the master environment or other library functions.

 

See also SETLOCAL.

 

Example:

 

This library function defines three local variables, which are only valid inside the function:

 

testfunc2 {

 local test, computer, server

 set test=abc

 set computer=Asus

 set server=PrintServer

command1

command2

...

}