Quote:
> Hi,
> I have written the following script
> test
> wscript.echo digit
> function test
> digit=10
> After running the script, the wscript.echo digit display blank, how can I
> declare a digit as public variable ?
> Thanks
To answer your specific question, in the global code declare the variable; and
don't declare it in the procedure. Like this:
dim digit
test
wscript.echo digit
function test
digit = 10
end function
It looks like you used a contrived example, but let me point out that a
function will return a value when executed, so you might as well use it. This
also makes it easy to avoid having variables with broad scope all over:
wscript.echo test
function test
test = 10
end function
--
Please respond in the newsgroup so everyone may benefit.
http://dev.remotenetworktechnology.com
(email requests for support contract information welcomed)
----------
Subscribe to Microsoft's Security Bulletins:
http://www.microsoft.com/technet/security/bulletin/notify.asp