Private Sub Button1_Click
Label1.Text = IIf(IsNumber(TextField1.Text) = False, "Invalid number", IIf(TextField1.Text > number, "My number is smaller", IIf(TextField1.Text < number, "My number is larger", "Well done!!!")))
End Sub
Private Sub Button1_Click
Label1.Text = IIf(IsNumber(TextField1.Text) = False, "Invalid number", _
IIf(TextField1.Text > number, "My number is smaller", _
IIf(TextField1.Text < number, "My number is larger", "Well done!!!")))
End Sub
Private Sub Button1_Click
Label1.Text = IIf(IsNumber(TextField1.Text) = False, "Invalid number", IIf(TextField1.Text > number, "My number is smaller", IIf(TextField1.Text < number, "My number is larger", "Well done!!!")))
End Sub
I think B4X already is what you said except for the last part of your statement, which I don’t agree. B4X is the most not verbose programming language I ever see without compromising the easiness for beginners.
I think B4X already is what you said except for the last part of your statement, which I don’t agree. B4X is the most not verbose programming language I ever see without compromising the easiness for beginners.
My first programming language is C in school, it took me so long to understand the for-loop. When I learn VB6 I love how simple it is to write a for-next loop. B4X shares the similar syntax and that’s what I like about the language.
@Erel Just an observation I had while testing the BANano Tanspiler support for the new .As functionality:
B4X:
' here I was expecting some kind of warning in the B4J compiler as I'm casting a Future (from GetCSS) to a String (I forgot the .Value after the GetCSS).
Log("JQAS: " & row2c1.As(JQueryElement).GetCSS("background-color").As(String).IndexOf("128"))
Is Future a special case or is this because every Object can be converted to a String (e.g. for Logging)?
Here for example, I do get a correct warning #22, and even an expected Compile error:
B4X:
Dim jq As MyFirstClass
jq.Initialize("test")
Log(jq.mysecond.As(MyFirstClass)) '<-------- here I get a warning #22 because mysecond is of the type MySecondClass
The underlying Java compiler is smart enough to know that MySecondClass cannot be converted to MyFirstClass, so it throws an error during compilation.
All types can be cast to Object and vice versa.