blob: 4d9ba8ee7795a17f3a62173a36e5ac4cb38830bf [file] [log] [blame]
<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<link href="book.css" rel="stylesheet" type="text/css">
<meta content="DocBook XSL Stylesheets V1.75.1" name="generator">
<link rel="home" href="index.html" title="QVT Declarative Documentation">
<link rel="up" href="qvtimperative.html" title="qvtimperative">
<link rel="prev" href="ConnectionVariable.html" title="ConnectionVariable">
<link rel="next" href="GuardParameter.html" title="GuardParameter">
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<h1 xmlns:l="">
<div class="section" title="DeclareStatement">
<div class="titlepage">
<h2 class="title" style="clear: both">
<a name="DeclareStatement"></a>
<span class="bold"><strong>
<code class="code">DeclareStatement</code>
<p>A DeclareStatement declares a variable and initial value.</p>
<code class="code">check var name : type := expression;</code>
<code class="code">type</code> or
<code class="code">expression</code> but not both may be omitted. An omitted type is deduced from the initial expression values.
<code class="code">check</code> may be omitted when the expression type is necessarily conformant.
<a class="link" href="VariableStatement.html" title="VariableStatement">
<code class="code">VariableStatement</code>
<a class="link" href="ObservableStatement.html" title="ObservableStatement">
<code class="code">ObservableStatement</code>
<span class="bold"><strong>Attributes</strong></span>
<code class="code">isCheck : Boolean[?]</code>
<p>True if the initial expression&rsquo;s type must be checked for conformance with the variable&rsquo;s type.
A non-conforming vlaue is a predicate failure causing the mapping to fail without doing anything.
This is a derivation of not ownedInit.type.conformsTo(self.type).</p>
<span class="bold"><strong>Associations</strong></span>
<code class="code">ownedExpression : OCLExpression[1]</code>
<p>The expression computing the variable&rsquo;s value.</p>