
28/12/2002, 15:06
|
| | Fecha de Ingreso: abril-2002
Mensajes: 438
Antigüedad: 23 años Puntos: 2 | |
Hola,
Simplemente por el tema de evitar variables globales que hacen que el código no sea portable, ¿por qué en vez de un sub no declaras LeerRegistro como una función y devuelves el dato? Te quedaría muchísimo más elegante y mejor programado. Algo así:
Public function LeerRegistro(direccion As String) as string
Dim Objeto
Set Objeto = CreateObject("wscript.shell")
LeerRegistro= Objeto.regread(direccion)
Set objeto=nothing
End function
Y punto y final, todas las demás variables no valen pa nada.
Saludos. |