What exactly do you mean by this? If you do whatever this is does it now compile with 6.87? If so then please post an example of the code that doesn't compile and the changed code that does.Yes weird, I don't know why cos if I write Dim As String before use it, it build perfectly...
Sub App_Start
var="Ca fonctionne pas"
alerte(var)
End Sub
Sub alerte(txt)
Msgbox(txt)
End Sub
Sub App_Start
[color=red]Dim var As String[/color]
var="Ca fonctionne!"
alerte(var)
End Sub
Sub alerte(txt)
Msgbox(txt)
End Sub
Sub Globals
'Declare the global variables here.
Dim Status(10) As Boolean
End Sub
Sub App_Start
For i = 0 To 4
Status(i)=True
Next
For n = 0 To 9
str=str & ";" & Status(n)
Next
Msgbox(str)
'Not OK
If Status(1)=True Then
Msgbox(Status(1))
End If
'OK
If Status(1) Then
Msgbox(Status(1))
End If
End Sub
'Not OK
If Status(1)=True Then
Msgbox(Status(1))
End If
'OK
If Status(1) Then
Msgbox(Status(1))
End If
'Not OK
If Status(1)=False Then
Msgbox(Status(1))
End If
'OK
If Status(1)=True Then
Msgbox(Status(1))
End If
what's is the problem exactly?
'Not OK
If Status(1)=True Then
'OK
If Status(1)=True Then
If Status(1) Then
If Status(1)=False Then
'or:
If not(Status(1)) Then
'Not OK
If Status(1)=True Then
Msgbox(Status(1))
End If
'OK
If Status(1) Then
Msgbox(Status(1))
End If
'OK
If Status(1) Then
Msgbox("True: "&Status(1))
Else 'Not Ok
Msgbox("False: "&Status(1))
End If
'True
If Statuts(1) Then
-----------------
If Statuts(1)=True Then
If Not(Statuts(1)) Then
----------------------
if Statuts(1)=False then
This code doesn't work when I want compile but work on run mode:
And this code work perfectly when I want compile and I want just run:B4X:Sub App_Start var="Ca fonctionne pas" alerte(var) End Sub Sub alerte(txt) Msgbox(txt) End Sub
Strange no?B4X:Sub App_Start [COLOR=red]Dim var As String[/COLOR] var="Ca fonctionne!" alerte(var) End Sub Sub alerte(txt) Msgbox(txt) End Sub
Hi,
this code does not work correctly:
'Not OK
If Status(1)=True Then
Msgbox(Status(1))
End If
'Not OK
If Status1=True Then
Msgbox(Status1)
End If
This is a bug. What Filippo is correctly pointing out is that this If statement fails in the IDE and when compiled.
A regular variable does work OK.B4X:'Not OK If Status(1)=True Then Msgbox(Status(1)) End If
The problem is that, at least when compiled, the compiler omits the "ToLower" method call when the comparison is made with an array variable that it correctly appends to a comparison with a normal variable.B4X:'Not OK If Status1=True Then Msgbox(Status1) End If
Sub Globals
'Declare the global variables here.
Dim Status(10) As Boolean
End Sub
No, It is a .NET Boolean type, which is actually a single byte but this is not visible to a managed language. The comparison code looks likeIn which case would Status(n) not be a numeric of some sort and thus contain no alpha characters to be case sensitive?
http://www.b4x.com/forum/beta-versions/5637-v6-87-available.html#post33228I don't get any error with this code. Does it fail for anybody else?
What error do you get?
Please start a new thread for this problem as this one has become a mess.
No it's not. As I pointed out in post #16 it's an internal compiler error where it is indexing outside the bounds of one of its collections.Apparently it return that "texte" it's an array or "alerte"
@sitajony, I've uploaded a new version of the desktop IDE with debugging information.
In order to download it you need to replace Basic4ppc-Beta.zip with Desktop.zip in the download URL.
Afterward copy both files to your installation folder. The about box should show v6.871.
This version fixes the boolean array issue and a bug with the recent files list.
When you encounter an error it should show a msgbox with the stack trace. Please take a screenshot of this message.
Sub App_Start
var="Ca fonctionne?"
alerte(var)
End Sub
Sub alerte(txt)
Msgbox(txt)
End Sub