Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Newby question about references in VB.NET

Status
Not open for further replies.

SpankySpanky

Programmer
May 25, 2005
21
0
0
AU
Please forgive the trivial question, but I cannot work this out.

I want to be able to do the following:

dim A as integer
dim B as object = A
B=33

and I need A to become 33. In other words I want to tell B to be a pointer or reference to A so that when I assign to B then that changes A.

Is this possible in VB.NET? I would rather not go unmanaged if possible.
 
Pretty sure this won't work because it would require an automatic up-cast from object (the type of B) to an int (the type of A), and the language just won't do that.

Chip H.


____________________________________________________________________
If you want to get the best response to a question, please read FAQ222-2244 first
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top