Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Variables to use in more than one sub

Reply
Thread Tools

Variables to use in more than one sub

 
 
dancer
Guest
Posts: n/a
 
      09-20-2007
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.


 
Reply With Quote
 
 
 
 
Sam
Guest
Posts: n/a
 
      09-20-2007
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" <(E-Mail Removed)> wrote in message
news:O3NQRm4%(E-Mail Removed)...
> 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.
>



 
Reply With Quote
 
 
 
 
Tim Mackey
Guest
Posts: n/a
 
      09-20-2007
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" <(E-Mail Removed)> wrote in message
news:O3NQRm4%(E-Mail Removed)...
> 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.
>


 
Reply With Quote
 
Just Me
Guest
Posts: n/a
 
      09-20-2007
Using modules to declare public variables is of course possible, but to me
it begs the question, has one come up with a good design. I think having 59
public variables would suggest that improvements could be made to the OOP.

Good OOP class design ususally tried to make the class self contained in
terms of functionality. To have 59 of those in one class, although possible
*suggests* at least a '*Potential*' for loss of control and/or integrety.

I would be wary of this.

Now if your talking about system settings for contant values like
CompanyName, Phone, AdministratorsName, etc etc etc. then there are better
ways to do this than using a module.

I think the OP needs to explain why he needs these in order to get a better
insight from the experts in this group


HTH



"Sam" <(E-Mail Removed)> wrote in message
news:ug05ft4%(E-Mail Removed)...
> 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" <(E-Mail Removed)> wrote in message
> news:O3NQRm4%(E-Mail Removed)...
>> 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.
>>

>
>



 
Reply With Quote
 
Sam
Guest
Posts: n/a
 
      09-20-2007
Just Me,

I agree with what you are saying. However, since I don't know much of the
details of his application, time frame that he has to implement the changes
for the business, his language skills. I'm giving couple of quick fix
options that he can do.

Sam

"Just Me" <news.microsoft.com> wrote in message
news:Ojjj$c5%(E-Mail Removed)...
> Using modules to declare public variables is of course possible, but to me
> it begs the question, has one come up with a good design. I think having
> 59 public variables would suggest that improvements could be made to the
> OOP.
>
> Good OOP class design ususally tried to make the class self contained in
> terms of functionality. To have 59 of those in one class, although
> possible *suggests* at least a '*Potential*' for loss of control and/or
> integrety.
>
> I would be wary of this.
>
> Now if your talking about system settings for contant values like
> CompanyName, Phone, AdministratorsName, etc etc etc. then there are better
> ways to do this than using a module.
>
> I think the OP needs to explain why he needs these in order to get a
> better insight from the experts in this group
>
>
> HTH
>
>
>
> "Sam" <(E-Mail Removed)> wrote in message
> news:ug05ft4%(E-Mail Removed)...
>> 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" <(E-Mail Removed)> wrote in message
>> news:O3NQRm4%(E-Mail Removed)...
>>> 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.
>>>

>>
>>

>
>



 
Reply With Quote
 
Just Me
Guest
Posts: n/a
 
      09-20-2007
Dont get me wrong. It was not meant as a criticism, just an alternate view.


"Sam" <(E-Mail Removed)> wrote in message
news:u%23r$jB6%(E-Mail Removed)...
> Just Me,
>
> I agree with what you are saying. However, since I don't know much of the
> details of his application, time frame that he has to implement the
> changes for the business, his language skills. I'm giving couple of quick
> fix options that he can do.
>
> Sam
>
> "Just Me" <news.microsoft.com> wrote in message
> news:Ojjj$c5%(E-Mail Removed)...
>> Using modules to declare public variables is of course possible, but to
>> me it begs the question, has one come up with a good design. I think
>> having 59 public variables would suggest that improvements could be made
>> to the OOP.
>>
>> Good OOP class design ususally tried to make the class self contained in
>> terms of functionality. To have 59 of those in one class, although
>> possible *suggests* at least a '*Potential*' for loss of control and/or
>> integrety.
>>
>> I would be wary of this.
>>
>> Now if your talking about system settings for contant values like
>> CompanyName, Phone, AdministratorsName, etc etc etc. then there are
>> better ways to do this than using a module.
>>
>> I think the OP needs to explain why he needs these in order to get a
>> better insight from the experts in this group
>>
>>
>> HTH
>>
>>
>>
>> "Sam" <(E-Mail Removed)> wrote in message
>> news:ug05ft4%(E-Mail Removed)...
>>> 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" <(E-Mail Removed)> wrote in message
>>> news:O3NQRm4%(E-Mail Removed)...
>>>> 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.
>>>>
>>>
>>>

>>
>>

>
>



 
Reply With Quote
 
dancer
Guest
Posts: n/a
 
      09-21-2007
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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" <(E-Mail Removed)> wrote in message
> news:O3NQRm4%(E-Mail Removed)...
>> 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.
>>

>



 
Reply With Quote
 
dancer
Guest
Posts: n/a
 
      09-21-2007
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" <(E-Mail Removed)> wrote in message
news:eHl0GXG$(E-Mail Removed)...
> 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" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> 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" <(E-Mail Removed)> wrote in message
>> news:O3NQRm4%(E-Mail Removed)...
>>> 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.
>>>

>>

>
>



 
Reply With Quote
 
Tim Mackey
Guest
Posts: n/a
 
      09-22-2007
hi,
if you have the .Net SDK installed on your computer, then you can look up
the documentation on how to use the compiler. i'm sure you can also run
"vbc /?" to get a list of options. if i were you i would download Visual
Web Developer (free version of Visual Studio) and then you don't need to
worry about command line syntax etc.
msdn.microsoft.com/vstudio/express/vwd/

good luck
tim

"dancer" <(E-Mail Removed)> wrote in message
news:e35FlEH$(E-Mail Removed)...
>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" <(E-Mail Removed)> wrote in message
> news:eHl0GXG$(E-Mail Removed)...
>> 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" <(E-Mail Removed)> wrote in message
>> news:(E-Mail Removed)...
>>> 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" <(E-Mail Removed)> wrote in message
>>> news:O3NQRm4%(E-Mail Removed)...
>>>> 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.
>>>>
>>>

>>
>>

>
>


 
Reply With Quote
 
dancer
Guest
Posts: n/a
 
      09-25-2007
I have Visual Web Developer Express Edition, but it is overwhelming - trying
to learn the program AND the oop concept.
I am following a tutorial that is making OOP make sense to me, so I want to
continue for a while.
I figured out how to use vbc. But now I need to know how to tell what is
in a dll file. I compiled a .vb file that created a .dll. But my aspx file
that is supposed to use it ignores the info in it, if there is any. Is
there any way to see what is in that dll file?

Thanks!


"Tim Mackey" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> hi,
> if you have the .Net SDK installed on your computer, then you can look up
> the documentation on how to use the compiler. i'm sure you can also run
> "vbc /?" to get a list of options. if i were you i would download Visual
> Web Developer (free version of Visual Studio) and then you don't need to
> worry about command line syntax etc.
> msdn.microsoft.com/vstudio/express/vwd/
>
> good luck
> tim
>
> "dancer" <(E-Mail Removed)> wrote in message
> news:e35FlEH$(E-Mail Removed)...
>>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" <(E-Mail Removed)> wrote in message
>> news:eHl0GXG$(E-Mail Removed)...
>>> 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" <(E-Mail Removed)> wrote in message
>>> news:(E-Mail Removed)...
>>>> 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" <(E-Mail Removed)> wrote in message
>>>> news:O3NQRm4%(E-Mail Removed)...
>>>>> 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.
>>>>>
>>>>
>>>
>>>

>>
>>

>



 
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
Death To Sub-Sub-Sub-Directories! Lawrence D'Oliveiro Java 92 05-20-2011 06:50 AM
Can one declare more than one signal on one line? Merciadri Luca VHDL 4 11-01-2010 02:00 PM
Like all great travelers, I have seen more than I remember andremember more than I have seen. shenrilaa@gmail.com C Programming 0 03-05-2008 03:26 AM
Recognising Sub-Items and sub-sub items using xslt Ben XML 2 09-19-2007 09:35 AM
Will one ASP .Net worker process use more than one CPU? =?Utf-8?B?Sm9obiBCYWlsZXk=?= ASP .Net 3 09-14-2007 05:32 PM



Advertisments