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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Structure enclosed another structure. How to access it?

Status
Not open for further replies.

WomanPro

Programmer
Nov 1, 2012
180
GR
Public Structure info
Public x As Byte
Public z As Byte
public y as byte
Public Structure internalInfo
Dim str As String
dim str2 as string
End Structure
End Structure
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim Info as new info
info.internalInfo.str="afasdfas"

End Sub

Error 2 Reference to a non-shared member requires an object reference.
I can declare it as dim Info as new info.internalinfo
but I can't access too x,z,y fields. I can't say info.x=10 what can I do to access all the fields at once??? Any suggestions please??? Any help will be much appreciated. Thank you so much in advanced.
 
SOLVED [bigsmile]
Public Structure info
Public x As Byte
Public z As Byte
public y as byte
public internal_info as InternalInfo
Public Structure internalInfo
Dim str As String
dim str2 as string
End Structure
End Structure

With that statement I can access it from anywhere :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top