Tema
:
entorno variables
Ver Mensaje Individual
#
3
(
permalink
)
23/03/2004, 10:34
AlZuwaga
Colaborador
Fecha de Ingreso: febrero-2001
Ubicación: 34.517 S, 58.500 O
Mensajes: 14.550
Antigüedad: 24 años, 2 meses
Puntos: 535
Ok, acá está:
Cita:
Scope and Lifetime of Variables
A variable's scope is determined by where you declare it. When you declare a variable within a procedure, only code within that procedure can access or change the value of that variable. It has local scope and is a procedure-level variable.
If you declare a variable outside a procedure, you make it recognizable to all the procedures in your script. This is a script-level variable, and it has script-level scope.
The lifetime of a variable depends on how long it exists. The lifetime of a script-level variable extends from the time it is declared until the time the script is finished running.
At procedure level, a variable exists only as long as you are in the procedure
. When the procedure exits, the variable is destroyed. Local variables are ideal as temporary storage space when a procedure is executing.
You can have local variables of the same name in several different procedures because each is recognized only by the procedure in which it is declared
.
Saludos
AlZuwaga
Ver Perfil
Buscar todos los Mensajes de AlZuwaga