1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
|
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>Lvalues (linke Werte)</title><meta name="generator" content="DocBook XSL Stylesheets Vsnapshot"><link rel="home" href="index.html" title="Genius-Handbuch"><link rel="up" href="ch06.html" title="Chapter 6. Programmierung mit GEL"><link rel="prev" href="ch06s08.html" title="Referenzen"><link rel="next" href="ch07.html" title="Chapter 7. Fortgeschrittene Programmierung mit GEL"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Lvalues (linke Werte)</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch06s08.html">Prev</a> </td><th width="60%" align="center">Chapter 6. Programmierung mit GEL</th><td width="20%" align="right"> <a accesskey="n" href="ch07.html">Next</a></td></tr></table><hr></div><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="genius-gel-lvalues"></a>Lvalues (linke Werte)</h2></div></div></div><p lang="en">
An lvalue is the left hand side of an assignment. In other words, an
lvalue is what you assign something to. Valid lvalues are:
</p><div class="variablelist"><dl class="variablelist"><dt><span lang="en" class="term"><strong class="userinput"><code>a</code></strong></span></dt><dd><p lang="en">
Identifier. Here we would be setting the variable of name
<code class="varname">a</code>.
</p></dd><dt><span lang="en" class="term"><strong class="userinput"><code>*a</code></strong></span></dt><dd><p lang="en">
Dereference of an identifier. This will set whatever variable
<code class="varname">a</code> points to.
</p></dd><dt><span lang="en" class="term"><strong class="userinput"><code>a@(<region>)</code></strong></span></dt><dd><p lang="en">
A region of a matrix. Here the region is specified normally as with
the regular @() operator, and can be a single entry, or an entire
region of the matrix.
</p></dd></dl></div><p lang="en">
</p><p lang="en">
Examples:
</p><pre lang="en" class="programlisting">a:=4
*tmp := 89
a@(1,1) := 5
a@(4:8,3) := [1,2,3,4,5]'
</pre><p lang="en">
Note that both <code class="literal">:=</code> and <code class="literal">=</code> can be used
interchangeably. Except if the assignment appears in a condition.
It is thus always safer to just use
<code class="literal">:=</code> when you mean assignment, and <code class="literal">==</code>
when you mean comparison.
</p></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch06s08.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ch06.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ch07.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Referenzen </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 7. Fortgeschrittene Programmierung mit GEL</td></tr></table></div></body></html>
|