Tuesday, April 17, 2012

[Ada] Case Syntax

          Hello, Reader ^^! Back again with source code. This time is a basic syntax Case in Ada programming language. This source code is to show how to do Case statement in Ada language. Here's the template:



case <variable name> is
   when <variable condition 1> =>
       <statement 1 if variable fulfills condition 1>
   when <variable condition 2> =>
       <statement 2 if variable fulfills condition 2>
   when <variable condition 3> =>
       <statement 3 if variable fulfills condition 3>
   when <variable condition 4> =>
       <statement 4 if variable fulfills condition 4>
   when <variable condition N> =>
       <statement N if variable fulfills condition N>
   when others =>
       <statement if variable doesn't fulfill any condition>
end case;


Note: " when others" is optional


Okay, that's all I can say. Thank you for reading ^^!

Download/View Source Code
Dropbox
Dropbox (Repository)
GitHub
GitHub (Repository)







No comments:

Post a Comment