By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,134 Members | 1,275 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,134 IT Pros & Developers. It's quick & easy.

Array syntax question - sorry

P: n/a
Sorry to ask a simple question on syntax but the line inside the
subroutine "assignBitmapArray" won't compile giving me an "Expression
Expected" error. What is the correct syntax to initialize an array of
Objects/Bitmaps?
Thank you
Colin
Public Structure testStruct
Dim testBitmap() As Bitmap
End Structure

Dim globalStruct As testStruct

Private Sub assignBitmapArray
globalStruct.testBitmap = {new Bitmap("c:\tb\WApp01\flower023.bmp")}
End Sub
Nov 20 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
* co***********@lycos.co.uk (Colin McGuire) scripsit:
Sorry to ask a simple question on syntax but the line inside the
subroutine "assignBitmapArray" won't compile giving me an "Expression
Expected" error. What is the correct syntax to initialize an array of
Objects/Bitmaps? [...] Public Structure testStruct
Dim testBitmap() As Bitmap
End Structure

Dim globalStruct As testStruct

Private Sub assignBitmapArray
globalStruct.testBitmap = {new Bitmap("c:\tb\WApp01\flower023.bmp")}
End Sub


\\\
Public Structure testStruct
Dim testBitmap() As Bitmap
End Structure

Dim globalStruct As testStruct

Private Sub assignBitmapArray()
globalStruct.testBitmap = New Bitmap() {New Bitmap("c:\tb\WApp01\flower023.bmp")}
End Sub
///

--
Herfried K. Wagner
MVP VB Classic, VB.NET
<http://www.mvps.org/dotnet>
Nov 20 '05 #2

P: n/a
> globalStruct.testBitmap = New Bitmap() {New
Bitmap("c:\tb\WApp01\flower023.bmp")}
Of course it is. Thank you Herfried.
Colin

"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:u4**************@TK2MSFTNGP11.phx.gbl...
* co***********@lycos.co.uk (Colin McGuire) scripsit:
Sorry to ask a simple question on syntax but the line inside the
subroutine "assignBitmapArray" won't compile giving me an "Expression
Expected" error. What is the correct syntax to initialize an array of
Objects/Bitmaps? [...]
Public Structure testStruct
Dim testBitmap() As Bitmap
End Structure

Dim globalStruct As testStruct

Private Sub assignBitmapArray
globalStruct.testBitmap = {new Bitmap("c:\tb\WApp01\flower023.bmp")}
End Sub


\\\
Public Structure testStruct
Dim testBitmap() As Bitmap
End Structure

Dim globalStruct As testStruct

Private Sub assignBitmapArray()
globalStruct.testBitmap = New Bitmap() {New

Bitmap("c:\tb\WApp01\flower023.bmp")} End Sub
///

--
Herfried K. Wagner
MVP VB Classic, VB.NET
<http://www.mvps.org/dotnet>


Nov 20 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.