Abstract

Executable statements define the actions of functions, procedures and rules. They define the logic and actions needed to support the definition of constraints by acting on parameters, local variables and constants. The shortest possible ‘executable’ statement is just a semicolon. It is called a null statement because it does nothing. Such a statement is not useless, however, as you can use a null statement to stake out territory for future use, or perhaps to make the absence of a statement stand out more clearly as in the example following. …IF a = 13 THEN ; -- do nothing ELSE b := 5 ; -- otherwise give b a value END_IF ;... The Alias statement gives a short name (alias) to an identifier that might be long or clumsy to write. The alias exists only in the scope of the alias statement and references to the alias is the same as writing out the identifier out in full. The assignment statement is used to give a value to a local variable or parameter. The type of the expression assigned to the variable must be compatible with the variable or parameter. Some assignments are shown below. The target variable and the expression being assigned to it are assignment compatible if any of the following hold true: • The types are the same. • The expression results in a type which is a subtype of the type declared for the variable being assigned to. • The type of the variable being assigned to is a select type and the expression results in a type which is a member of that select type. The Case statement executes one (or perhaps zero) statement based on the value of an expression. The statement executed is chosen depending on the value of the Selector. The case statement consists of an expression, which is the case selector and a list of alternative actions, each one preceded by a case label. Agreement between the type of the case label and the case selector is required. The first occurring statement having a case label that evaluates to the same value of the case selector is executed.

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call

Disclaimer: All third-party content on this website/platform is and will remain the property of their respective owners and is provided on "as is" basis without any warranties, express or implied. Use of third-party content does not indicate any affiliation, sponsorship with or endorsement by them. Any references to third-party content is to identify the corresponding services and shall be considered fair use under The CopyrightLaw.