View Single Post
  #128 (permalink)  
Old 11-24-2009, 09:14 AM
agraham's Avatar
agraham agraham is offline
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 6,072
Awards Showcase
Innovator medal Beta Tester Forum Contributer 
Total Awards: 3
Default

It's a bug in your code I'm afraid ( EDIT - no it's not ). I've rearranged the IF statement as I don't like single line IFs.

Code:
If FileExist(FN) Then
    mapslist.Item(ind) = FN <font color=
"Red">' Error! assigning a string not an image</font>
Else
    mapslist.Item(ind) = mapslist.Item(
0) <font color="SeaGreen">' OK, this is an image assignment</font>
End If
This works in the IDE because the assignment checks if a string is being assigned and reads the bitmap from the file if it is a string. The optimising compiler just does the assignment without checking.

EDIT:- I've just looked at the help for ImageList.Item and it states that what you are doing should work so it looks like a compiler bug.
__________________
Sorry, but I don't answer questions by PM or email.
Please post your queries in the forum.

Last edited by agraham : 11-24-2009 at 11:15 AM.
Reply With Quote