v6.87 is available

sitajony

Active Member
Licensed User
I've never install the V6.86...
The about box return that:

It's the V6.87...
So I've to uninstall the 6.80 version and reinstall the beta version?
I'll tell you it work :)
 

Attachments

sitajony

Active Member
Licensed User
I've deleted avey key about Basic4PPC, close every programs about Basic4PPC and uninstall all and reinstall but there's the same problem :(
What's the problem?
Else: Why it return "The license file is not found"? Why don't ask again "select the license file"? It mean that some configuration stay again in the registry, maybe some stuff come from the old version...
 

agraham

Expert
Licensed User
Yes weird, I don't know why cos if I write Dim As String before use it, it build perfectly...
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.
 

sitajony

Active Member
Licensed User
This code doesn't work when I want compile but work on run mode:
B4X:
Sub App_Start
 var="Ca fonctionne pas"
     alerte(var)
End Sub

Sub alerte(txt)
    Msgbox(txt)
End Sub
And this code work perfectly when I want compile and I want just run:
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
Strange no?
 
Last edited:

Filippo

Expert
Licensed User
Boolean-Problem

Hi,

this code does not work correctly:
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
 

sitajony

Active Member
Licensed User
B4X:
'Not OK
If Status(1)=True Then
Msgbox(Status(1))
End If

'OK
If Status(1) Then
Msgbox(Status(1))
End If
It's the same condition...
Would you write that?:
B4X:
'Not OK
If Status(1)=False Then
Msgbox(Status(1))
End If

'OK
If Status(1)=True Then
Msgbox(Status(1))
End If
(Maybe i'm wrong)
what's is the problem exactly?
 

mjcoon

Well-Known Member
Licensed User
what's is the problem exactly?
Yes: what is the difference between (1st box)
B4X:
'Not OK
If Status(1)=True Then
and (2nd box)
B4X:
'OK
If Status(1)=True Then
I agree that the "=True" is superfluous but should still work.

Similarly "=False" could alternatively be "Not ()".

Mike.
 

sitajony

Active Member
Licensed User
I don't understand what do you want do...

True may be write like that too:
B4X:
If Status(1) Then
And false:
B4X:
If Status(1)=False Then
'or:
If not(Status(1)) Then
And here you've type twice the same thing:
B4X:
'Not OK
If Status(1)=True Then
Msgbox(Status(1))
End If

'OK
If Status(1) Then
Msgbox(Status(1))
End If
So normaly it show twice the msgbox with "True"...
If you want show the msgbox only if it's True or False type:
B4X:
'OK
If Status(1) Then
Msgbox("True: "&Status(1))
Else 'Not Ok
Msgbox("False: "&Status(1))
End If
There's no difference between:
B4X:
'True
If Statuts(1) Then
-----------------
If Statuts(1)=True Then
And no difference for False:
B4X:
If Not(Statuts(1)) Then
----------------------
if Statuts(1)=False then
But They must be an Boolean entry too...
If I'm out subject tell me ;)
 
Last edited:

Erel

Administrator
Staff member
Licensed User
This code doesn't work when I want compile but work on run mode:
B4X:
Sub App_Start
 var="Ca fonctionne pas"
     alerte(var)
End Sub

Sub alerte(txt)
    Msgbox(txt)
End Sub
And this code work perfectly when I want compile and I want just run:
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
Strange no?
I 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.
 

agraham

Expert
Licensed User
This is a bug. What Filippo is correctly pointing out is that this If statement fails in the IDE and when compiled.
B4X:
'Not OK
If Status(1)=True Then
 Msgbox(Status(1))
End If
A regular variable does work OK.
B4X:
'Not OK
If Status1=True Then
 Msgbox(Status1)
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.
 

mjcoon

Well-Known Member
Licensed User
This is a bug. What Filippo is correctly pointing out is that this If statement fails in the IDE and when compiled.
B4X:
'Not OK
If Status(1)=True Then
 Msgbox(Status(1))
End If
A regular variable does work OK.
B4X:
'Not OK
If Status1=True Then
 Msgbox(Status1)
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.
Your mention of "ToLower" made me rush back to the originals and realise that both Filippo and sitajony are citing the same code snippets but Filippo has
B4X:
Sub Globals
'Declare the global variables here.
Dim Status(10) As Boolean
End Sub
In which case would Status(n) not be a numeric of some sort and thus contain no alpha characters to be case sensitive?

Mike.
 

agraham

Expert
Licensed User
In which case would Status(n) not be a numeric of some sort and thus contain no alpha characters to be case sensitive?
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 like

if (LCompareEqual(((Boolean[])var__main_status)[(int)(1d)].ToString(cul),@"true"))

The problem is that ToString on a True valued Boolean returns "True" and needs a ToLower to make it work

if (LCompareEqual(((Boolean[])var__main_status)[(int)(1d)].ToString(cul).ToLower(cul)(cul),@"true"))

In natural C# you would just do

if (status[1])

but the string circumlocution is necessary to allow comparisons of typed Booleans against untyped (string) boolean values.
 

sitajony

Active Member
Licensed User
Last edited:

agraham

Expert
Licensed User
Apparently it return that "texte" it's an array or "alerte"
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.

As Erel asked, you should start a new thread about this error.
 

Erel

Administrator
Staff member
Licensed User
@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.
 

sitajony

Active Member
Licensed User
@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.
Ok I download...

V6.871 with the error report:
Code:
B4X:
Sub App_Start
var="Ca fonctionne?"
alerte(var)
End Sub
Sub alerte(txt)
Msgbox(txt)
End Sub
 

Attachments

Last edited:
Top