1 <?xml version="1.0" encoding="UTF-8"?>
3 * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
4 * Copyright (C) 2017 - ESI-Group
6 * This file is hereby licensed under the terms of the GNU GPL v2.0,
7 * pursuant to article 5.3.4 of the CeCILL v.2.1.
8 * This file was originally licensed under the terms of the CeCILL v2.1,
9 * and continues to be available under such terms.
10 * For more information, see the COPYING file which you should have received
11 * along with this program.
15 <refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"
16 xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML"
17 xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org"
18 xml:lang="en" xml:id="toJSON">
20 <refname>toJSON</refname>
22 Convert scilab variable to JSON.
29 result = toJSON(var, indent)
30 result = toJSON(var, filename)
31 result = toJSON(var, indent, filename)
35 <title>Arguments</title>
41 The Scilab variable to convert in JSON format.
49 If a file name is given, the conversion is written in this file.
57 If this argument is given, the result is indented. The value is the size of TAB.
65 Result is a string which contain the data converted to JSON.
66 If a filename is given, no result is returned.
73 <title>Description</title>
75 This function convert a Scilab variable into a string or JSON files.
79 <title>Examples</title>
80 <programlisting role="example"><![CDATA[
81 st = struct("status", "OK", "value", 12);
84 st = struct("test", ["a" "b"], "values", [1 2]);
88 <refsection role="see also">
89 <title>See also</title>
90 <simplelist type="inline">
92 <link linkend="http_post">http_post</link>
95 <link linkend="http_put">http_put</link>
98 <link linkend="http_patch">http_patch</link>
101 <link linkend="http_delete">http_delete</link>
104 <link linkend="http_upload">http_upload</link>
107 <link linkend="fromJSON">fromJSON</link>
110 <link linkend="http_get">http_get</link>
115 <title>History</title>
118 <revnumber>6.1</revnumber>