Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Error9 - 'Subscript out of Range' :/


Gepeto
 Share

Recommended Posts

Hello.

I'm working on some project. All I've done is, that I replaced some buttons and windows in frmMenu in Visual Studio 6, changed come captions like "Username" or "Password" and changed GUI picutres (names and locations are same, just changed pictures). Now, I can't run game - it writes Runtime Error 9 'Subscript out of Range'. No logs created.

Could anyone help me? :/

BTW: I'm running on Eclipse 3.0 Nightly Releases with Event System - Runtime files installed and computer rebooted.
Link to comment
Share on other sites

> i'm guessing this is because you are using .png files for the gui. they need to be .jpg/bmp files in order for it to load unless you are using gdi+ to load it. i'm not sure if that helps but yea lol.

No, I've not changed type of files. I just open them in Logo Motion, edit them and then save them with same name and same type (for instance, I firstly created pictures with invisible backgrounds, then I realized that that won't work in .JPG and it will be appeared as white background, so picutres are certainly in .JPG). But Thanks.

> Run it on VB6 then tell me what is the highligted code

I'm sorry, but I don't know how to do this. I edit project in VB6 and then save it. Everything okay. I create .EXE file. Everything is okay, no Error window. Then I run that .EXE file and problem appears here. How can I run it in VB6 to let it highlight wrong code? Because in VB6 it acts like everything is okay.
Link to comment
Share on other sites

Well, I think I've got it.

This is block of code that looks wrong:

Private Sub Form_Load()

Dim i As Long

' If debug mode, handle error then exit out

If Options.Debug = 1 Then On Error GoTo errorhandler

' move the entire attributes box on screen

picAttributes.Left = 8

picAttributes.Top = 8

GraphicSelX = 0

GraphicSelY = 0

GraphicSelX2 = 0

GraphicSelY2 = 0

PopulateLists

cmbSoundEffect.Clear

**For i = 1 To UBound(soundCache)**

cmbSoundEffect.AddItem (soundCache(i))

Next

cmbSoundEffect.ListIndex = 0

' Error handler

Exit Sub

errorhandler:

HandleError "Form_Load", "frmEditor_Map", Err.Number, Err.Description, Err.Source, Err.HelpContext

Err.Clear

Exit Sub

End Sub

What is bloded is what is yellow-underlighted. So something is wrong with sounds? I deleted all sound files because I'd like to add my own later. I though that If I delete them, game will just ignore that setp and won't use sounds (like in case of music).
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...