LucaMs Expert Licensed User Longtime User Jul 1, 2021 #101 Erel said: Testing nested IIf: Code: 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 Guess my number game. Click to expand... You can do it because you have two monitors side by side and you can see half of the line on the first and the rest on the second ?
Erel said: Testing nested IIf: Code: 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 Guess my number game. Click to expand... You can do it because you have two monitors side by side and you can see half of the line on the first and the rest on the second ?
LucaMs Expert Licensed User Longtime User Jul 1, 2021 #102 LucaMs said: You can do it because you have two monitors side by side and you can see half of the line on the first and the rest on the second ? Click to expand... B4X: 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 Last edited: Jul 1, 2021
LucaMs said: You can do it because you have two monitors side by side and you can see half of the line on the first and the rest on the second ? Click to expand... B4X: 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 Ilya G. Active Member Licensed User Longtime User Jul 1, 2021 #103 Erel said: Testing nested IIf: Code: 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 Guess my number game. Click to expand... Will this also be in the next release?
Erel said: Testing nested IIf: Code: 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 Guess my number game. Click to expand... Will this also be in the next release?
Erel B4X founder Staff member Licensed User Longtime User Jul 1, 2021 #104 GanjaKyp said: Will this also be in the next release? Click to expand... Yes. Beta version of B4J with these two features will be released today.
GanjaKyp said: Will this also be in the next release? Click to expand... Yes. Beta version of B4J with these two features will be released today.
LucaMs Expert Licensed User Longtime User Jul 3, 2021 #106 B4X: Dim Index As Int = Sender.As(B4XView).Tag It was useful to me right away. BTW IIF too!!! [for a small program that will make me a few thousand euros every month, even less than 10, perhaps ?] P.S. IIF another time, right now: B4X: Dim Sign as int = IIf(EventData.PrimaryButtonPressed, 1, - 1) (I'm not sure I've given the variable a proper name but that's okay ) Last edited: Jul 3, 2021
B4X: Dim Index As Int = Sender.As(B4XView).Tag It was useful to me right away. BTW IIF too!!! [for a small program that will make me a few thousand euros every month, even less than 10, perhaps ?] P.S. IIF another time, right now: B4X: Dim Sign as int = IIf(EventData.PrimaryButtonPressed, 1, - 1) (I'm not sure I've given the variable a proper name but that's okay )
NGUYEN TUAN ANH Active Member Licensed User Longtime User Jul 6, 2021 #107 I think B4X should make everything clear, logic and coherence would be better, especially for newbies, although it might have to write more commands.
I think B4X should make everything clear, logic and coherence would be better, especially for newbies, although it might have to write more commands.
AnandGupta Expert Licensed User Longtime User Jul 6, 2021 #108 NGUYEN TUAN ANH said: especially for newbies, although it might have to write more commands. Click to expand... The excellent guide is made for newbies, please check B4A Documentation www.b4x.com
NGUYEN TUAN ANH said: especially for newbies, although it might have to write more commands. Click to expand... The excellent guide is made for newbies, please check B4A Documentation www.b4x.com
aeric Expert Licensed User Longtime User Jul 6, 2021 #109 NGUYEN TUAN ANH said: I think B4X should make everything clear, logic and coherence would be better, especially for newbies, although it might have to write more commands. Click to expand... 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.
NGUYEN TUAN ANH said: I think B4X should make everything clear, logic and coherence would be better, especially for newbies, although it might have to write more commands. Click to expand... 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.
aeric Expert Licensed User Longtime User Jul 6, 2021 #110 aeric said: 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. Click to expand... 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. C: for (i=0; i<10; i++){ // do something } B4X: For i = O to 9 'Do something Next
aeric said: 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. Click to expand... 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. C: for (i=0; i<10; i++){ // do something } B4X: For i = O to 9 'Do something Next
alwaysbusy Expert Licensed User Longtime User Jul 8, 2021 #111 @Erel Just an observation I had while testing the BANano Tanspiler support for the new .As functionality: Code: ' 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: Code: 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 Code: B4J Version: 9.10 BETA #2 Parsing code. (0.01s) Java Version: 11 Building folders structure. (0.54s) Compiling code. (0.27s) Compiling layouts code. (0.06s) Organizing libraries. (0.00s) Compiling generated Java code. Error B4J line: 29 Log(\ src\com\ab\b4jsdemo\main.java:90: error: incompatible types: mysecondclass cannot be converted to myfirstclass anywheresoftware.b4a.keywords.Common.Log("test: "+BA.ObjectToString(((com.ab.b4jsdemo.myfirstclass)(_jq._mysecond /*com.ab.b4jsdemo.mysecondclass*/ )))); Alwaysbusy
@Erel Just an observation I had while testing the BANano Tanspiler support for the new .As functionality: Code: ' 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: Code: 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 Code: B4J Version: 9.10 BETA #2 Parsing code. (0.01s) Java Version: 11 Building folders structure. (0.54s) Compiling code. (0.27s) Compiling layouts code. (0.06s) Organizing libraries. (0.00s) Compiling generated Java code. Error B4J line: 29 Log(\ src\com\ab\b4jsdemo\main.java:90: error: incompatible types: mysecondclass cannot be converted to myfirstclass anywheresoftware.b4a.keywords.Common.Log("test: "+BA.ObjectToString(((com.ab.b4jsdemo.myfirstclass)(_jq._mysecond /*com.ab.b4jsdemo.mysecondclass*/ )))); Alwaysbusy
Erel B4X founder Staff member Licensed User Longtime User Jul 9, 2021 #112 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.
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.
alwaysbusy Expert Licensed User Longtime User Jul 9, 2021 #113 Erel said: All types can be cast to Object Click to expand... And as String too? (the Java .toString I would think)
Erel said: All types can be cast to Object Click to expand... And as String too? (the Java .toString I would think)
Erel B4X founder Staff member Licensed User Longtime User Jul 9, 2021 #114 Yes (with a very few exceptions related to arrays).
Sergio Castellari Active Member Licensed User Longtime User Jul 30, 2021 #115 AnandGupta said: Yes. POLL: What do you use B4X for I may participate if you added "for learning programming" option. Done www.b4x.com It is still true. For example, in HMG, users also contribute towards the development. Click to expand... Hola, Si, y en el foro de ooHG también. Seguramente por que el espiritu del grupo es igual q B4X. Saludos cordiales, Sergio translation Yes, and on the ooHG forum as well. Surely because the spirit of the group is equal to q B4X. Kind regards,
AnandGupta said: Yes. POLL: What do you use B4X for I may participate if you added "for learning programming" option. Done www.b4x.com It is still true. For example, in HMG, users also contribute towards the development. Click to expand... Hola, Si, y en el foro de ooHG también. Seguramente por que el espiritu del grupo es igual q B4X. Saludos cordiales, Sergio translation Yes, and on the ooHG forum as well. Surely because the spirit of the group is equal to q B4X. Kind regards,