imbault Well-Known Member Licensed User Longtime User Nov 11, 2014 #1 Hi Erel, I was thinking if it's difficul for you to add "Code blocks" in B4i and B4a. This feature I use with Groovy (called closures) is very interesting and very powerfull: Super simple example B4X: def clos = { println "hello!" } println "Executing the Closure:" clos() //prints "hello!" http://groovy.codehaus.org/Closures
Hi Erel, I was thinking if it's difficul for you to add "Code blocks" in B4i and B4a. This feature I use with Groovy (called closures) is very interesting and very powerfull: Super simple example B4X: def clos = { println "hello!" } println "Executing the Closure:" clos() //prints "hello!" http://groovy.codehaus.org/Closures
LucaMs Expert Licensed User Longtime User Nov 11, 2014 #2 B4X: Public Sub Close(Msg As String, ShowToast As Boolean) If ShowToast Then ToastMessageShow(Msg, True) Else Log(Msg) End If End Sub Close("Hello!", True) ?
B4X: Public Sub Close(Msg As String, ShowToast As Boolean) If ShowToast Then ToastMessageShow(Msg, True) Else Log(Msg) End If End Sub Close("Hello!", True) ?
imbault Well-Known Member Licensed User Longtime User Nov 11, 2014 #3 @LucaMs Calling a function and embedding code in a "pseudo" variable called def in Groovy is not really the same...
@LucaMs Calling a function and embedding code in a "pseudo" variable called def in Groovy is not really the same...
LucaMs Expert Licensed User Longtime User Nov 11, 2014 #4 not exactly but enough to not need that functionality