Hi
Lesson07 in the Microsoft VB6 course ...
I would like to enhance the Loop to skip over image files
that do not exist eg: C:\vb6sbs\less07\misc05.ico
This is some of the code I have done ...
For iImg = 0 To 3
iIcon = i
sIcon = iIcon
If i < 10 Then
sIcon = "0" & i
End If
Err.Clear
img2.Picture = LoadPicture("C:\vb6sbs\less07\misc" & sIcon & ".ico"
If Err.Number <> 0 Then
If iImg > 0 Then
iImg = iImg - 1
End If
Err.Clear
Else
img1(iImg).Picture = LoadPicture("C:\vb6sbs\less07\misc" & sIcon & ".ico"
End If
i = i + 1
Next
Program fills the 4 images the first time round,
but stops with Error when sIcon has the value "05"
How can I skip over these non-existant image files ?
Lesson07 in the Microsoft VB6 course ...
I would like to enhance the Loop to skip over image files
that do not exist eg: C:\vb6sbs\less07\misc05.ico
This is some of the code I have done ...
For iImg = 0 To 3
iIcon = i
sIcon = iIcon
If i < 10 Then
sIcon = "0" & i
End If
Err.Clear
img2.Picture = LoadPicture("C:\vb6sbs\less07\misc" & sIcon & ".ico"
If Err.Number <> 0 Then
If iImg > 0 Then
iImg = iImg - 1
End If
Err.Clear
Else
img1(iImg).Picture = LoadPicture("C:\vb6sbs\less07\misc" & sIcon & ".ico"
End If
i = i + 1
Next
Program fills the 4 images the first time round,
but stops with Error when sIcon has the value "05"
How can I skip over these non-existant image files ?