Bug? 'Then' Expected

yttrium

Active Member
Licensed User
Longtime User
Getting a weird false error when compiling.

Code: Copy
Parsing code.                          0.02
Compiling code.                        Error
Error compiling program.
Error description: 'Then' expected.
Occurred on line: 178
If 13 < Age =< 60 Then
Word: =

Suspected it was the = sign, perhaps B4A doesn't support that kind of comparison? So I tried that:

Code: Copy
Parsing code.                          0.02
Compiling code.                        Error
Error compiling program.
Error description: 'Then' expected.
Occurred on line: 178
If 13 < Age < 60 OR Age = 60 Then
Word: <

I also tried rewriting the entire line and segment, but still got the error.

The sub is as follows:


Code: Copy
Sub CalculateBtn_Click
   Dim Age As Int = DateUtils.PeriodBetweenInDays(DateTime.Date(DateTime.Now), BirthDate)
   If 13 < Age < 60 Then
   Else If (60 < Age < 150) OR (Age = 150) Then
   Else If (150 < Age < 180) OR (Age = 180) Then
   Else If 180 < Age Then
   End If
End Sub

Any ideas?
 
Can B4A really not do multiple comparisons? Damn.

That fixed it.
 
As far as I know, VB.NET supported it.
 
Back
Top