| 1 |
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>Parameter variables</title><meta name="generator" content="DocBook XSL Stylesheets Vsnapshot"><link rel="home" href="index.html" title="Manual do Genius"><link rel="up" href="ch06.html" title="Chapter 6. Programming with GEL"><link rel="prev" href="ch06s05.html" title="Global Variables and Scope of Variables"><link rel="next" href="ch06s07.html" title="Returning"></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">Parameter variables</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch06s05.html">Prev</a> </td><th width="60%" align="center">Chapter 6. Programming with GEL</th><td width="20%" align="right"> <a accesskey="n" href="ch06s07.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-parameters"></a>Parameter variables</h2></div></div></div><p lang="en"> |
| 2 |
As we said before, there exist special variables called parameters |
| 3 |
that exist in all scopes. To declare a parameter called |
| 4 |
<code class="varname">foo</code> with the initial value 1, we write |
| 5 |
</p><pre lang="en" class="programlisting">parameter foo = 1 |
| 6 |
</pre><p lang="en"> |
| 7 |
From then on, <code class="varname">foo</code> is a strictly global variable. |
| 8 |
Setting <code class="varname">foo</code> inside any function will modify the |
| 9 |
variable in all contexts, that is, functions do not have a private |
| 10 |
copy of parameters. |
| 11 |
</p><p lang="en"> |
| 12 |
When you undefine a parameter using the |
| 13 |
<a class="link" href="ch11s02.html#gel-function-undefine"> |
| 14 |
<code class="function">undefine</code></a> function, it stops being |
| 15 |
a parameter. |
| 16 |
</p><p lang="en"> |
| 17 |
Some parameters are built-in and modify the behavior of genius. |
| 18 |
</p></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch06s05.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="ch06s07.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Global Variables and Scope of Variables </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Returning</td></tr></table></div></body></html> |