question about variables and subprocedure

  • Thread starter Thread starter Britt
  • Start date Start date
B

Britt

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
 
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
 
Thanks

rowe_newsgroups said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top