From ThingML

Main: Actions

Action Language

The ThingML action language is somehow a subset of commonly used programming language (Java, C), etc.: +, -, =, etc. Only the essence is provided: < and > to compare numeric values, but not >= and <=. If that annoys you, please directly contact Franck Fleurey.

Boolean expressions

you should use "or", "and" keywords

Exchanging messages

//sends the hello message (with "world" as parameter) via the helloPort
helloPort!hello("world")
//this is the syntax to use on transitions and internal transitions to react to an event (not really and action)
//here t correspond to a timer_start message received on the timer port
event t : timer?timer_start

Control structure

if (i == 16) do ... end//no else in ThingML. Again, complain to Franck.

var i : Integer = 0
while(i < 16) do//no for loop in ThingML
  ...
  i = i + 1//don't even dream of something like i++
end
Retrieved from https://thingml.org/pmwiki.php?n=Main.Actions
Page last modified on January 25, 2012, at 02:38 PM