Array syntax question - sorry

  • Thread starter Thread starter Colin McGuire
  • Start date Start date
C

Colin McGuire

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
 
* (e-mail address removed) (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
///
 
globalStruct.testBitmap = New Bitmap() {New
Bitmap("c:\tb\WApp01\flower023.bmp")}


Of course it is. Thank you Herfried.
Colin



Herfried K. Wagner said:
* (e-mail address removed) (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
///
 
Back
Top