From de56586f1bcdeb60db431b8fe4b7aa531c9444d6 Mon Sep 17 00:00:00 2001 From: kinoshita-eos Date: Wed, 3 Dec 2014 09:12:45 +0900 Subject: [PATCH] Add: tutorial for PIONE about case statement. new file: SampleCode/PIONE/Basic7/EvenOdd2.pione --- SampleCode/PIONE/Basic7/EvenOdd2.pione | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 SampleCode/PIONE/Basic7/EvenOdd2.pione diff --git a/SampleCode/PIONE/Basic7/EvenOdd2.pione b/SampleCode/PIONE/Basic7/EvenOdd2.pione new file mode 100644 index 0000000..11b6e4a --- /dev/null +++ b/SampleCode/PIONE/Basic7/EvenOdd2.pione @@ -0,0 +1,24 @@ +param $val := 123 + +Rule Main + output 'message.txt' +Flow + case $val % 2 + when 0 + rule Even + else + rule Odd + end +End + +Rule Even + output 'message.txt' +Action + echo "{$val} is even." > {$O[1]}; +End + +Rule Odd + output 'message.txt' +Action + echo "{$val} is odd." > {$O[1]}; +End \ No newline at end of file -- 2.11.0