Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Private Subroutines

Reply
Thread Tools

Private Subroutines

 
 
Victor
Guest
Posts: n/a
 
      08-25-2006
In ASP, if I define a subroutine as private

Private Sub mySubroutine(arg1, arg2)

I understand that the variables I define inside the subroutine are local only to the
subroutine. If the same variable is defined outside the subroutine, it won't conflict
(right?)

What about variables that are defined outside the subroutine, but not inside? Are they
available inside the subroutine?

Thanks,

Vic


 
Reply With Quote
 
 
 
 
Bob Barrows [MVP]
Guest
Posts: n/a
 
      08-25-2006
Victor wrote:
> In ASP,


I assume you mean "vbscript", not "ASP"

> if I define a subroutine as private
>
> Private Sub mySubroutine(arg1, arg2)
>
> I understand that the variables I define inside the subroutine are
> local only to the subroutine. If the same variable is defined outside
> the subroutine, it won't conflict (right?)


Test it:

>
> What about variables that are defined outside the subroutine, but not
> inside? Are they available inside the subroutine?
>

Yes, variables assigned outside subroutines are global.

Here's a simple test:
<%
Dim x
x=1
response.write "outside - before call to foo: " & x & "<BR>"
foo
response.write "outside - after call to foo: " & x & "<BR>"
foo2
response.write "outside - after call to foo2: " & x & "<BR>"

sub foo()
dim x
x="inside foo"
response.write x & "<BR>"
end sub

sub foo2()
Response.Write "inside foo2 - initial value of x: " & x & "<BR>"
x=x+1
Response.Write "inside foo2 - final value of x: " & x & "<BR>"
end sub
%>


Do you have the vbscript documentation? If not, you can get it here:
http://tinyurl.com/7rk6

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"


 
Reply With Quote
 
 
 
 
Victor
Guest
Posts: n/a
 
      08-25-2006

"Bob Barrows [MVP]" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
:
> Do you have the vbscript documentation? If not, you can get it here:
> http://tinyurl.com/7rk6
>


Bob, this has been a BIG help to me today, THANKS!

Are there .CFM files for database stuff, like SQL? I've been looking, can't find them.

Thanks again,

Vic
(very new)





 
Reply With Quote
 
Bob Barrows [MVP]
Guest
Posts: n/a
 
      08-26-2006
Victor wrote:
> "Bob Barrows [MVP]" <(E-Mail Removed)> wrote in message
> news:%(E-Mail Removed)...
>>
>> Do you have the vbscript documentation? If not, you can get it here:
>> http://tinyurl.com/7rk6
>>

>
> Bob, this has been a BIG help to me today, THANKS!
>
> Are there .CFM files for database stuff, like SQL? I've been looking,
> can't find them.
>

Which database?

SQL Server (Books OnLine - aka BOL) documentation can be found here:
http://www.microsoft.com/sql/techinf...2000/books.asp

For Access, you need to use the online help.

Or are you asking for sql language help in general? I know of no generic
online source of sql assistance.
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"


 
Reply With Quote
 
Victor
Guest
Posts: n/a
 
      08-30-2006
"Bob Barrows [MVP]" wrote...
> Victor wrote:
> > "Bob Barrows [MVP]" wrote...
> >>
> >> Do you have the vbscript documentation? If not, you can get it here:
> >> http://tinyurl.com/7rk6
> >>

> >
> > Bob, this has been a BIG help to me today, THANKS!
> >
> > Are there .CFM files for database stuff, like SQL? I've been looking,
> > can't find them.
> >

> Which database?
>
> SQL Server (Books OnLine - aka BOL) documentation can be found here:
> http://www.microsoft.com/sql/techinf...2000/books.asp
>
> For Access, you need to use the online help.
>
> Or are you asking for sql language help in general? I know of no generic
> online source of sql assistance.


SQL Server or SQL Language. Actually, I'm partial to the MS help file format because
it's easy to use and very easy search, and I can efficiently use them when my laptop is
on battery and not connected to the internet.

> --
> Microsoft MVP - ASP/ASP.NET
> Please reply to the newsgroup. This email account is my spam trap so I
> don't check it very often. If you must reply off-line, then remove the
> "NO SPAM"
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How to keep your private files private Steve Computer Support 1 02-21-2006 08:24 PM
Re: How to keep your private files private HMV Computer Support 0 02-21-2006 04:54 PM
Public Data in Private Class or Private Data in Public Class? DaveLessnau C++ 3 05-16-2005 06:53 PM
RE: Why I use private variables (WAS: RE:"private" variablesa.k.a. name mangling?) Jeremy Bowers Python 3 01-24-2005 10:52 PM
Should 'public virtual' always become 'private virtual'? & using private inheritance qazmlp C++ 19 02-04-2004 12:37 AM



Advertisments