I was expecting the same, however in my case even the most outer If doesn’t work if I use the curly brakes.
Maybe its me, since I have long history in using Basic in several versions (last B4Android).
I’m using OH2, but that shouldn’t make such a syntax-change. I’m a bit lost
a=b -> let’s set a = b
a==b -> compare, if a is equal to b
In fact, this is wrong in every if-clause.
In question of the logInfo, better write
logInfo("Benzin","Benzinpreis 1 = {}",OK)
as the first arg is the logger name, the second arg is the log to print. If you want to use more arguments to dynamically change the log line, add curly brackets for every value and add the args as a comma separated list…
Yes, my syntax was crying out loud, I’m a BASIC programmer! There are some more pittfalls when changing to C or JAVA, it’s not only the “writeln” instead of “write” and the required ; at end end of each statement. I totally forgot.
Works like a charm now!
Just to be clear, the Rules programming language is a Domain Specific Language (DSL) that bears the most resemblance to Xtend. While Java classes are available within Xtend and therefore the Rules (DSL), this language bears little resemblance to Java or C in most respects.