G
Guest
Hello group,
I am trying to get used to vb.net coming from a far far far away set of tools.
What i want to do is setup an object in my application that contains other
object types, that act like collections.
For example:
objQuotes.Quotes("2004-10-08").Item("MSFT").StockQuote = "45.45"
The structure really needs to be laid out like this:
StockData holds a Quotes collection for each day - the day would be the key.
The quotes object would have an object for each stock i'd like to record
data for.. each stock needs to record several properties, like the
symbol/ticker, an internal ID, the value, and the market valuation.
I just can't seem to get to where I want to be with collections:
The code I am trying looks like:
Public Structure typeStocks
Dim Items As Collection
End Structure
Public Structure typeStocksData
Dim Items As Collection
End Structure
Public Structure typeQuote
Dim StockID As Integer
Dim Quote As Decimal
Dim MarketCap As Long
End Structure
But the problem is that to get data out I have to create a bunch of objects
like:
objQuotes = objStockData.Items("2004-10-08")
objQuote = objQuotes.Item("MSFT")
MsgBox(objQuote.StockQuote)
Can anyone help me get this figured out?? I am just not following how to
get to where I want from where I am!
Many thanks!
I am trying to get used to vb.net coming from a far far far away set of tools.
What i want to do is setup an object in my application that contains other
object types, that act like collections.
For example:
objQuotes.Quotes("2004-10-08").Item("MSFT").StockQuote = "45.45"
The structure really needs to be laid out like this:
StockData holds a Quotes collection for each day - the day would be the key.
The quotes object would have an object for each stock i'd like to record
data for.. each stock needs to record several properties, like the
symbol/ticker, an internal ID, the value, and the market valuation.
I just can't seem to get to where I want to be with collections:
The code I am trying looks like:
Public Structure typeStocks
Dim Items As Collection
End Structure
Public Structure typeStocksData
Dim Items As Collection
End Structure
Public Structure typeQuote
Dim StockID As Integer
Dim Quote As Decimal
Dim MarketCap As Long
End Structure
But the problem is that to get data out I have to create a bunch of objects
like:
objQuotes = objStockData.Items("2004-10-08")
objQuote = objQuotes.Item("MSFT")
MsgBox(objQuote.StockQuote)
Can anyone help me get this figured out?? I am just not following how to
get to where I want from where I am!
Many thanks!