473,326 Members | 2,127 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Variables to use in more than one sub

Using ASP.net 1.1 and VB.Net

What is the SIMPLEST way to have 2 subroutines use the same variables (59 of
them)? I don't know much about OOP. I need a way that uses very few
concepts until I get a grasp of the process.
Sep 20 '07 #1
10 1240
Sam
If the 2 subroutines in the same class, you can use a class scope variable
with in that class. If they are in separate classes, you can declare a
variable in a module which is visible to all classes

Sam

"dancer" <da****@microsoft.comwrote in message
news:O3****************@TK2MSFTNGP02.phx.gbl...
Using ASP.net 1.1 and VB.Net

What is the SIMPLEST way to have 2 subroutines use the same variables (59
of them)? I don't know much about OOP. I need a way that uses very few
concepts until I get a grasp of the process.

Sep 20 '07 #2
hi
since you are in asp.net, i am guessing that the code you are writing will
be in a page. Every page in asp.net is a class. if you put your variables
inside the class declaration, all the subroutines can share the variables.
if you are in visual studio, the 'class' is defined in the code-behind file.
the asp.net quickstart tutorials are a great way to learn about asp.net.
http://samples.gotdotnet.com/quickstart/aspplus/
you will need to learn about OOP to get good at .net so it will be well
worth your time. here is another link to a VB.Net OOP introduction:
http://www.codeproject.com/vb/net/OOPS_In_VBNET.asp
plenty more on http://www.google.com/search?q=vb.net%20OOP

hope this helps
tim
"dancer" <da****@microsoft.comwrote in message
news:O3****************@TK2MSFTNGP02.phx.gbl...
Using ASP.net 1.1 and VB.Net

What is the SIMPLEST way to have 2 subroutines use the same variables (59
of them)? I don't know much about OOP. I need a way that uses very few
concepts until I get a grasp of the process.
Sep 20 '07 #3
Thanks for replying.
I looked here www.developerfusion.co.uk/vbnet/288/ - from the google page
you suggested.
I was trying the tutorial. It was making a lot of sense. But then I hit a
snag. The same snag that somebody else hit.
This is a question posed by another student, but it was not answered:

"I am very impressed by your tutorial as it finally allowed me to grasp the
syntax behind OOP programming with .net.
Only what I did not understand is how and where do I complile the .cs to a
dll? I cannot do it on the server. Do I do it on my local computer and then
upload? "

Would you know the answer to this question? I tried doing it from my
command prompt. I tried doing it from my localhost. No luck. I tried
putting the .cs code directly in my aspx file. Still no luck. What am I
missing?


"Tim Mackey" <ti********@community.nospamwrote in message
news:B9**********************************@microsof t.com...
hi
since you are in asp.net, i am guessing that the code you are writing will
be in a page. Every page in asp.net is a class. if you put your
variables inside the class declaration, all the subroutines can share the
variables. if you are in visual studio, the 'class' is defined in the
code-behind file.
the asp.net quickstart tutorials are a great way to learn about asp.net.
http://samples.gotdotnet.com/quickstart/aspplus/
you will need to learn about OOP to get good at .net so it will be well
worth your time. here is another link to a VB.Net OOP introduction:
http://www.codeproject.com/vb/net/OOPS_In_VBNET.asp
plenty more on http://www.google.com/search?q=vb.net%20OOP

hope this helps
tim
"dancer" <da****@microsoft.comwrote in message
news:O3****************@TK2MSFTNGP02.phx.gbl...
>Using ASP.net 1.1 and VB.Net

What is the SIMPLEST way to have 2 subroutines use the same variables (59
of them)? I don't know much about OOP. I need a way that uses very few
concepts until I get a grasp of the process.

Sep 21 '07 #4
I do have the vbc.exe on my computer in both
c:\WINNT\Microsoft.NET\Framework\v1.1.4322 and also in
v2.0.50727

"dancer" <da****@microsoft.comwrote in message
news:eH**************@TK2MSFTNGP05.phx.gbl...
Thanks for replying.
I looked here www.developerfusion.co.uk/vbnet/288/ - from the google page
you suggested.
I was trying the tutorial. It was making a lot of sense. But then I hit a
snag. The same snag that somebody else hit.
This is a question posed by another student, but it was not answered:

"I am very impressed by your tutorial as it finally allowed me to grasp
the syntax behind OOP programming with .net.
Only what I did not understand is how and where do I complile the .cs to a
dll? I cannot do it on the server. Do I do it on my local computer and
then upload? "

Would you know the answer to this question? I tried doing it from my
command prompt. I tried doing it from my localhost. No luck. I tried
putting the .cs code directly in my aspx file. Still no luck. What am I
missing?


"Tim Mackey" <ti********@community.nospamwrote in message
news:B9**********************************@microsof t.com...
>hi
since you are in asp.net, i am guessing that the code you are writing
will be in a page. Every page in asp.net is a class. if you put your
variables inside the class declaration, all the subroutines can share the
variables. if you are in visual studio, the 'class' is defined in the
code-behind file.
the asp.net quickstart tutorials are a great way to learn about asp.net.
http://samples.gotdotnet.com/quickstart/aspplus/
you will need to learn about OOP to get good at .net so it will be well
worth your time. here is another link to a VB.Net OOP introduction:
http://www.codeproject.com/vb/net/OOPS_In_VBNET.asp
plenty more on http://www.google.com/search?q=vb.net%20OOP

hope this helps
tim
"dancer" <da****@microsoft.comwrote in message
news:O3****************@TK2MSFTNGP02.phx.gbl...
>>Using ASP.net 1.1 and VB.Net

What is the SIMPLEST way to have 2 subroutines use the same variables
(59 of them)? I don't know much about OOP. I need a way that uses very
few concepts until I get a grasp of the process.


Sep 21 '07 #5
dancer wrote:
Thank you. I am doing exactly what you recommend, except contributing to
the group, because I don't think I have anything to contribute yet.
But as for my question...... Can you tell me how to find out what is in a
dll file?
I hate suggesting this to you. But I think you are boxing above your
weight at the moment.
However if you are determined then check out Reflector
http://www.aisto.com/roeder/dotnet/ (And yes it is another IDE to learn)
Sep 26 '07 #6
"Mick Walker" <ma**********@privacy.netwrote in message
news:5l************@mid.individual.net...
However if you are determined then check out Reflector
http://www.aisto.com/roeder/dotnet/ (And yes it is another IDE to learn)
Am I missing something here...?

In VWD, is it not possible to add a reference to the DLL in question and
then inspect it with Object Browser...?
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Sep 26 '07 #7
Without reading all the way up, if this is a .net dll then you can use
ILDASM to inspect whats inside the assembly. But this is probably more than
you need to know, most people never go there ;-D


"Mark Rae [MVP]" <ma**@markNOSPAMrae.netwrote in message
news:Oa****************@TK2MSFTNGP03.phx.gbl...
"Mick Walker" <ma**********@privacy.netwrote in message
news:5l************@mid.individual.net...
>However if you are determined then check out Reflector
http://www.aisto.com/roeder/dotnet/ (And yes it is another IDE to learn)

Am I missing something here...?

In VWD, is it not possible to add a reference to the DLL in question and
then inspect it with Object Browser...?
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Sep 26 '07 #8
"Just Me" <news.microsoft.comwrote in message
news:O4**************@TK2MSFTNGP02.phx.gbl...
Without reading all the way up, if this is a .net dll then you can use
ILDASM to inspect whats inside the assembly. But this is probably more
than you need to know, most people never go there ;-D
Indeed so - I took it from the OP that he just needed to see the
interface...
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Sep 26 '07 #9
Ahh. . . OK, btw, i'm making good headway in the shopping cart stakes.

Ta Very Much.
"Mark Rae [MVP]" <ma**@markNOSPAMrae.netwrote in message
news:OQ**************@TK2MSFTNGP03.phx.gbl...
"Just Me" <news.microsoft.comwrote in message
news:O4**************@TK2MSFTNGP02.phx.gbl...
>Without reading all the way up, if this is a .net dll then you can use
ILDASM to inspect whats inside the assembly. But this is probably more
than you need to know, most people never go there ;-D

Indeed so - I took it from the OP that he just needed to see the
interface...
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Sep 26 '07 #10
"Just Me" <news.microsoft.comwrote in message
news:uU**************@TK2MSFTNGP03.phx.gbl...
btw, i'm making good headway in the shopping cart stakes.
See? Didn't I tell you I knew you could do it...? ;-)
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Sep 26 '07 #11

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

Similar topics

27
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...
6
by: David T. Ashley | last post by:
Hi, In my project, I typically declare and define variables in the .H file, i.e. DECMOD_MAIN UINT8 can_message_201_status_global #ifdef MODULE_MAIN = HAS_NEVER_BEEN_RECEIVED #endif ;
7
by: Michael | last post by:
Hi newsgroup, as the subject indicates I am looking for an advice using global variables. I am not if this problem is more about style then C. If its wrong in thi group, sorry. So I have a...
31
by: Harry Simpson | last post by:
I've come from the old ASP camp where session variables were not used. When i started using ASP.NET in 2001, I started using them again because it was ok from what I'd read. I've been merrily...
6
by: Clausfor | last post by:
Hello, I have a problem with restoring variables in the setjmp/longjmp functions: K&R2 for longjmp says: "Accessible objects have the same value they had when longjmp was called, except for...
18
by: BillE | last post by:
When a user opens a new IE browser window using File-New-Window the integrity of an application which relies on session state is COMPLETELY undermined. Anyone who overlooks the fact that...
26
by: BillE | last post by:
Some ASP.NET applications use Session Variables extensively to maintain state. These should be re-written to use viewstate, hidden fields, querystring, etc. instead. This is because if a user...
55
by: Zytan | last post by:
I see that static is more restricted in C# than in C++. It appears usable only on classes and methods, and data members, but cannot be created within a method itself. Surely this is possible in...
0
by: Gary Herron | last post by:
Jacob Davis wrote: Yuck, YUCK, YUCK! You are breaking *so* many good-programming-practices, I hardly know where to start. First off: A python global is not what you think. There are *no*...
9
by: raashid bhatt | last post by:
does having more variables increases the size of program.
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.