473,385 Members | 1,356 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,385 software developers and data experts.

question about variables and subprocedure

Hi,

How have i to define variable 'a' in procedure 'Page_Load" in order to be
accessible in procedure "mysub()"?

Thanks
Britt
Partial class myclass
Protected Sub Page_Load(....)
dim a as table
.....
end sub
______________
sub mysub()
a=new Table
.....
end sub
end class


Nov 13 '06 #1
2 832
You'll have to do it outside the Sub for it to be "visible" to mysub.
Declare it with private scope so only the procedure in myclass can
access it.

Partial class myclass

private a as table

Protected Sub Page_Load(....)
....
end sub

sub mysub()
a=new Table
....
end sub

Thanks,

Seth Rowe
Britt wrote:
Hi,

How have i to define variable 'a' in procedure 'Page_Load" in order to be
accessible in procedure "mysub()"?

Thanks
Britt
Partial class myclass
Protected Sub Page_Load(....)
dim a as table
....
end sub
______________
sub mysub()
a=new Table
....
end sub
end class
Nov 13 '06 #2
Thanks

"rowe_newsgroups" <ro********@yahoo.comschreef in bericht
news:11**********************@f16g2000cwb.googlegr oups.com...
You'll have to do it outside the Sub for it to be "visible" to mysub.
Declare it with private scope so only the procedure in myclass can
access it.

Partial class myclass

private a as table

Protected Sub Page_Load(....)
....
end sub

sub mysub()
a=new Table
....
end sub

Thanks,

Seth Rowe
Britt wrote:
>Hi,

How have i to define variable 'a' in procedure 'Page_Load" in order to be
accessible in procedure "mysub()"?

Thanks
Britt
Partial class myclass
Protected Sub Page_Load(....)
dim a as table
....
end sub
______________
sub mysub()
a=new Table
....
end sub
end class

Nov 13 '06 #3

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

Similar topics

2
by: steve | last post by:
I have Option Explicit ON by the way. I have declared a variable in one subprocedure which is being used by another subprocedure. But it doesn' seem to work. I am doing something similar to this...
2
by: Rhino | last post by:
Is there any way to invoke and perform a given subroutine within an SQL procedure several different times, doing other work in between invocations of the subroutine? For instance, let's say that...
4
by: anonymous | last post by:
Thanks your reply. The article I read is from www.hakin9.org/en/attachments/stackoverflow_en.pdf. And you're right. I don't know it very clearly. And that's why I want to understand it; for it's...
7
by: Bob Morvay | last post by:
I am trying to determine how far I should go in encapsulating data. As I understand it, OO practices state to create private member variables and use these variables in your publicly accessible...
14
by: Coleen | last post by:
Hi All :-) We have an APSX application using VB.net as the code behind, which uses one or two session variables per page. These Session variables are passed to the final page and calculations...
0
by: Krys19 | last post by:
Express Edition Hi, my problem is I need to call a subprocedure and use DataTable Compute method to count and display the number of items priced under $20 it will be taken from the gridview...
7
by: Spam Catcher | last post by:
Hi All, If I have a procedure that obtains a sync lock: Public Sub A SyncLock Myobject B() End SyncLock And another procedure which obtains the same synclock:
2
cindy2
by: cindy2 | last post by:
Hi everybody, In my vb2005-project I have a subprocedure (in a MODULE) like this: Public Sub MakeInputArray() Input(0) = Form2.TextBox1.Text Input(1) = Form2.TextBox2.Text End Sub...
16
by: Donn Ingle | last post by:
Hello, Is there a way I can, for debugging, access the instance variable name from within a class? E.g: Class X: def debug(self): print "My instance var is %s" % (some magic Python stuff) ...
12
by: Bryan Parkoff | last post by:
I write my large project in C++ source code. My C++ source code contains approximate four thousand small functions. Most of them are inline. I define variables and functions in the global scope....
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
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...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.