Bug?: Compilation Error

splatt

Active Member
Licensed User
Longtime User
I have received this error message whilst trying to compile under 1.48:

B4X:
Compiling code.                         Error
Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
The line that stops the compilation is:

B4X:
File.MakeDir(File.DirDefaultExternal,"/images")

This hasn't changed since my first version of my app.

Interestingly, I reverted back to the 1.41 release and it compiled OK, but when I then go back to 1.48, it stops at this line again.
 

stevel05

Expert
Licensed User
Longtime User
I've just installed 1.48 and get the same error on a project that worked under 1.42.

The error message is:

Compiling code. Error
Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index

So no line number to trace:(

I'm not sure how to proceed with this one.

Steve
 

stevel05

Expert
Licensed User
Longtime User
I'll give it a go, but probably easier said than done, a second project also didn't compile, they are both large projects that contain access to a variety of libraries etc. I can't imagine what to include to get it to fail.

2 different projects did compile.

I'll see what I can come up with.

Steve
 

stevel05

Expert
Licensed User
Longtime User
Right on the money as usual, here's a very butchered example that causes the error.

Steve

Edit: Just made sure that it does compile in 1.42
 

Attachments

  • ct.zip
    5.2 KB · Views: 177
Last edited:

stevel05

Expert
Licensed User
Longtime User
And here's the second one. This compiles under 1.42 as well.

Steve
 

Attachments

  • ct2.zip
    5.3 KB · Views: 167

philgoodgood

Member
Licensed User
Longtime User
hi,
the same error as Splatt and Stevel05

B4X:
   Select RequetesSQL.query   
   Case 1,2,3,4,5,6,7,8,10
      PiedDePage(RequetesSQL.ChoixRequeteSQL)
      AfficheResultat(RequetesSQL.Cursor1, True)
   Case 9
      PiedDePage(RequetesSQL.ChoixRequeteSQL)
      AfficheResultat(RequetesSQL.Cursor1,True)
      activity.Title = RequetesSQL.nbAppellation
   Case 11
                .........

        [COLOR="Red"][B]Case Else[/B][/COLOR]
[COLOR="red"]                if empty line ==> error compil[/COLOR]
[COLOR="red"]with (but it doesn't matter)[/COLOR]   Msgbox("OK compil","") [COLOR="red"]==> compil OK[/COLOR]
        End Select
 
Last edited:

splatt

Active Member
Licensed User
Longtime User
This program fails with the same error on the same line:

B4X:
'Activity module
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
End Sub
 
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
End Sub
 
Sub Activity_Create(FirstTime As Boolean)
    Try
        File.MakeDir(File.DirDefaultExternal,"/images") '<- Error Here
    Catch
 
    End Try
End Sub
 
Sub Activity_Resume
End Sub
 
Sub Activity_Pause (UserClosed As Boolean)
End Sub
 
Top