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
 
Back
Top