AnandGupta Expert Licensed User Longtime User Jun 30, 2021 #81 Erel said: No. It is not a "real" method. It is a compiler feature. Click to expand... This got me thinking. Is it like pre-processor directive (a compiler feature of Clipper/XBase) ?
Erel said: No. It is not a "real" method. It is a compiler feature. Click to expand... This got me thinking. Is it like pre-processor directive (a compiler feature of Clipper/XBase) ?
LucaMs Expert Licensed User Longtime User Jun 30, 2021 #82 aeric said: I wish my national leaders would listen to the citizens voice before implementing a new law like what happened here. ? Click to expand... I apologize in advance for my post as it is not the right place; but its ending part... In Italy a relatively new party seemed to want to realize what you and I dream of; in addition, it streamed important meetings. In a short time it managed to get 33% of the votes in a national election. After that it disappointed everyone by not putting into practice what it proclaimed. What is the ending that can be interesting? That I'd like to see Erel streaming while he... Erel said: I went back to the drawing board Click to expand... More generally I'd like to see how he works. I think I've already written this in the past. When I asked him what tools he used, for example to generate diagrams, he replied: LucaMs said: I do not wonder at all if Erel used a UML editor. Click to expand... Erel said: No. Only paper and pen. Click to expand... LucaMs said: and correction fluid? Click to expand... Erel said: Never needed one. Click to expand... ?
aeric said: I wish my national leaders would listen to the citizens voice before implementing a new law like what happened here. ? Click to expand... I apologize in advance for my post as it is not the right place; but its ending part... In Italy a relatively new party seemed to want to realize what you and I dream of; in addition, it streamed important meetings. In a short time it managed to get 33% of the votes in a national election. After that it disappointed everyone by not putting into practice what it proclaimed. What is the ending that can be interesting? That I'd like to see Erel streaming while he... Erel said: I went back to the drawing board Click to expand... More generally I'd like to see how he works. I think I've already written this in the past. When I asked him what tools he used, for example to generate diagrams, he replied: LucaMs said: I do not wonder at all if Erel used a UML editor. Click to expand... Erel said: No. Only paper and pen. Click to expand... LucaMs said: and correction fluid? Click to expand... Erel said: Never needed one. Click to expand... ?
Erel B4X founder Staff member Licensed User Longtime User Jun 30, 2021 #83 It is not a preprocessor as it is managed together with all the code.
aeric Expert Licensed User Longtime User Jun 30, 2021 #84 LucaMs said: Never needed one. Click to expand... Because Erel uses second piece of paper. The first one already become crumpled ball. ?
LucaMs said: Never needed one. Click to expand... Because Erel uses second piece of paper. The first one already become crumpled ball. ?
Erel B4X founder Staff member Licensed User Longtime User Jun 30, 2021 #85 Another example: Code: Button1.As(JavaObject).RunMethod("setMouseTransparent", Array(True)) 'equivalent to: Dim jo As JavaObject = Button1 jo.RunMethod("setMouseTransparent", Array(True)) And a more complex one: Code: Log(Me.As(JavaObject).RunMethod("sum", Array((10).As(Float), (20).As(Double)))) 'equivalent to: Dim jme As JavaObject = Me Dim f As Float = 10 Dim d As Double = 20 Log(jme.RunMethod("sum", Array(f, d))) #if Java public double sum(float n1, double n2) { return n1 + n2; } #End If
Another example: Code: Button1.As(JavaObject).RunMethod("setMouseTransparent", Array(True)) 'equivalent to: Dim jo As JavaObject = Button1 jo.RunMethod("setMouseTransparent", Array(True)) And a more complex one: Code: Log(Me.As(JavaObject).RunMethod("sum", Array((10).As(Float), (20).As(Double)))) 'equivalent to: Dim jme As JavaObject = Me Dim f As Float = 10 Dim d As Double = 20 Log(jme.RunMethod("sum", Array(f, d))) #if Java public double sum(float n1, double n2) { return n1 + n2; } #End If
H Heuristx Active Member Licensed User Longtime User Jun 30, 2021 #86 So visually even constants can have "methods". Brilliant as always.
Sandman Expert Licensed User Longtime User Jun 30, 2021 #87 Erel said: Another example Click to expand... Great examples. Very clear and easy to like! ?
LucaMs Expert Licensed User Longtime User Jun 30, 2021 #88 Heuristx said: So visually even constants can have "methods". Brilliant as always. Click to expand... ? ?
Heuristx said: So visually even constants can have "methods". Brilliant as always. Click to expand... ? ?
Daestrum Expert Licensed User Longtime User Jun 30, 2021 #89 So using your example above, against a previous problem question posted in forum, we could now get the correct result. Original problem Code: Dim result As Long result=24*60*60*180*1000 ' Result was incorrect Could be written as Code: Dim result As Long result=24*60*60*180*(1000).As(Long) Which should result in the correct result.
So using your example above, against a previous problem question posted in forum, we could now get the correct result. Original problem Code: Dim result As Long result=24*60*60*180*1000 ' Result was incorrect Could be written as Code: Dim result As Long result=24*60*60*180*(1000).As(Long) Which should result in the correct result.
H Heuristx Active Member Licensed User Longtime User Jun 30, 2021 #91 LucaMs said: ? ? Click to expand... (10).As(Double) A constant expression like 10 has a method called .As()
LucaMs said: ? ? Click to expand... (10).As(Double) A constant expression like 10 has a method called .As()
LucaMs Expert Licensed User Longtime User Jun 30, 2021 #92 Heuristx said: (10).As(Double) A constant expression like 10 has a method called .As() Click to expand... ?
Heuristx said: (10).As(Double) A constant expression like 10 has a method called .As() Click to expand... ?
LucaMs Expert Licensed User Longtime User Jun 30, 2021 #93 LucaMs said: ? Click to expand... I would need glasses for the brain too, though. ?
H Heuristx Active Member Licensed User Longtime User Jun 30, 2021 #94 LucaMs said: I would need glasses for the brain too, though. ? Click to expand... See, I have glasses for the brain. Glasses and glasses. Of beer.
LucaMs said: I would need glasses for the brain too, though. ? Click to expand... See, I have glasses for the brain. Glasses and glasses. Of beer.
Alexander Stolte Expert Licensed User Longtime User Jun 30, 2021 #95 Soon we can write any app with B4X with only one line of code ?
H Heuristx Active Member Licensed User Longtime User Jul 1, 2021 #96 Alexander Stolte said: Soon we can write any app with B4X with only one line of code ? Click to expand... In 1986 a program code "listing" appeared in a magazine about the Sinclair Spectrum computer. The program defined graphics for a ship and a helicopter and the program made you control the helicopter to land on the ship(which was rocking in the ocean). The helicopter blew up if you missed the landing. The program consisted of 28 lines of Sinclair Basic code.
Alexander Stolte said: Soon we can write any app with B4X with only one line of code ? Click to expand... In 1986 a program code "listing" appeared in a magazine about the Sinclair Spectrum computer. The program defined graphics for a ship and a helicopter and the program made you control the helicopter to land on the ship(which was rocking in the ocean). The helicopter blew up if you missed the landing. The program consisted of 28 lines of Sinclair Basic code.
Erel B4X founder Staff member Licensed User Longtime User Jul 1, 2021 #97 Daestrum said: So using your example above, against a previous problem question posted in forum, we could now get the correct result. Original problem Click to expand... Yes. Better to start with the Long type as the expression is evaluated from left to right: Code: result=(24).As(Long)*60*60*180*1000
Daestrum said: So using your example above, against a previous problem question posted in forum, we could now get the correct result. Original problem Click to expand... Yes. Better to start with the Long type as the expression is evaluated from left to right: Code: result=(24).As(Long)*60*60*180*1000
Erel B4X founder Staff member Licensed User Longtime User Jul 1, 2021 #98 Alexander Stolte said: Soon we can write any app with B4X with only one line of code Click to expand... 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. Last edited: Jul 1, 2021
Alexander Stolte said: Soon we can write any app with B4X with only one line of code Click to expand... 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.
Daestrum Expert Licensed User Longtime User Jul 1, 2021 #99 It's nice to see @Erel enjoying this new functionality as much as the rest of us will when it gets released.
It's nice to see @Erel enjoying this new functionality as much as the rest of us will when it gets released.
udg Expert Licensed User Longtime User Jul 1, 2021 #100 Code: Label1.Text = IIf(edLanguageUsed.Text = "B4X", "Good choice, B4xer", IIf(edLanguageUsed.Text = "", "Start B4X Programming!","Switch to B4X. Right Now!")) ?
Code: Label1.Text = IIf(edLanguageUsed.Text = "B4X", "Good choice, B4xer", IIf(edLanguageUsed.Text = "", "Start B4X Programming!","Switch to B4X. Right Now!")) ?