help names: any length + UTF-8 accepted
[scilab.git] / scilab / modules / core / help / en_US / variables / names.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!--
3  * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
4  * Copyright (C) INRIA
5  * Copyright (C) 2017 - Samuel GOUGEON
6  *
7  * Copyright (C) 2012 - 2016 - Scilab Enterprises
8  *
9  * This file is hereby licensed under the terms of the GNU GPL v2.0,
10  * pursuant to article 5.3.4 of the CeCILL v.2.1.
11  * This file was originally licensed under the terms of the CeCILL v2.1,
12  * and continues to be available under such terms.
13  * For more information, see the COPYING file which you should have received
14  * along with this program.
15  *
16  -->
17 <refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"
18         xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML"
19         xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org"
20         xml:lang="en" xml:id="names">
21     <refnamediv>
22         <refname>names</refname>
23         <refpurpose>Naming rules for variables and functions</refpurpose>
24     </refnamediv>
25     <refsection>
26         <title>Description</title>
27         <para>
28             Names of variables and functions must begin with a letter or one of
29             the following special characters: <literal>% _ # ! ? $</literal>.
30         </para>
31         <para>
32             Next characters may be letters, digits, or any special character among
33             <literal>_ # ! $ ?</literal>.
34         </para>
35         <para>
36             Upper and lower case letters are different.
37         </para>
38         <para>
39             Multilingual UTF-8 characters are accepted.
40         </para>
41         <para>
42             Names may be as long as you want.
43         </para>
44     </refsection>
45     <refsection>
46         <title>Examples</title>
47         <programlisting role="example"><![CDATA[
48 // Valid names
49 %eps
50 A1 = 123
51 #Color = 8
52 þæ_Р= %pi
53
54 // Non valid names
55 //1A , b%, .C
56
57 // Long names
58 The_name_of_an_identifier_is_not_length_limited = 1
59
60 // A kilometric name:
61 name = strcat(part("a",ones(1,1000))); // 1000-char long
62 execstr(name+"=%pi; b ="+name);
63 b
64  ]]></programlisting>
65     </refsection>
66     <refsection role="history">
67         <title>History</title>
68         <revhistory>
69             <revision>
70                 <revnumber>6.0</revnumber>
71                 <revdescription>
72                     <itemizedlist>
73                         <listitem>
74                             Scilab's parser no longer truncates names longer than 24 characters.
75                         </listitem>
76                         <listitem>
77                             UTF-8 characters are now accepted in names of variables and fields.
78                         </listitem>
79                     </itemizedlist>
80                 </revdescription>
81             </revision>
82         </revhistory>
83     </refsection>
84 </refentry>