473,508 Members | 2,140 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Private Subroutines

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
Aug 25 '06 #1
5 1825
On 25/08/2006 01:55, Victor wrote:
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

Er, why not try it and find out ;-)
Aug 25 '06 #2
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"
Aug 25 '06 #3

"Bob Barrows [MVP]" <re******@NOyahoo.SPAMcomwrote in message
news:%2****************@TK2MSFTNGP03.phx.gbl...
:
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)

Aug 25 '06 #4
Victor wrote:
"Bob Barrows [MVP]" <re******@NOyahoo.SPAMcomwrote in message
news:%2****************@TK2MSFTNGP03.phx.gbl...
>>
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"
Aug 26 '06 #5
"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"


Aug 30 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

27
3780
by: gabor | last post by:
hi, as far as i know in python there aren't any private (i mean not accessible from the outside of the object) methods/fields. why? in java/c++ i can make a method private, this way...
3
2725
by: joe | last post by:
Hello: I am using IIS 5.0, ASP and VBScript. I am puzzled by recurrences of errors when I nest subroutines, and I'd like to know if there are rules for that which I don't know. Would functions...
8
5531
by: MLH | last post by:
What's the default declaration if Public/Private is ommited from the Sub statement in an Access 97 procedure?
3
2121
by: Bob Day | last post by:
Ok, I have done a lot of reading(of the newsgroup answers, help files and MSDN articles) of synclock. I understand what you are saying in the newsgroup, and it is very helpful. It does, however,...
7
2980
by: Microsoft | last post by:
I'm not sure where to physically place my subroutines in vb.net I get namespace and not declared errors... Imports System Imports System.Management Public Class Form1
3
1356
by: OpticTygre | last post by:
I have a class, ProcessFiles, with several subroutines it runs for each type of file I want to "process." First, I check directories for files. Then, based on the filenames of those I find in...
2
1604
by: dumbo | last post by:
Hello, who gives one more shining solution to me? My application load form "A". The form "A" by means of a push-button load form "B" that in its turn by means of a push-button load form "C". Form...
1
1706
by: Wijaya Edward | last post by:
Hi, How does one benchmark multiple subroutines in Python? Is there a built-in library for that? -- Regards, Edward WIJAYA SINGAPORE
10
2896
by: liz0001 | last post by:
Hi, I need to access an .asp subroutine file from a subdomain. i.e. the website is at www.domain.com and I want to access the same subroutines on the subdomain mobile.domain.com. The...
0
7228
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7332
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7393
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7058
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
1
5057
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3191
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1565
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
769
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
426
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.