forked from livecode/livecode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patharrayEncode.xml
More file actions
48 lines (48 loc) · 2.45 KB
/
Copy patharrayEncode.xml
File metadata and controls
48 lines (48 loc) · 2.45 KB
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<doc>
<legacy_id>3517</legacy_id>
<name>arrayEncode</name>
<type>function</type>
<syntax>
<example>arrayEncode(<i>array</i>)</example>
</syntax>
<library></library>
<objects>
</objects>
<synonyms>
</synonyms>
<classification>
<category>Writing LiveCode</category>
</classification>
<references>
<function tag="arrayDecode">arrayDecode Function</function>
<function tag="keys">keys Function</function>
<keyword tag="[]">[] Keyword</keyword>
<command tag="write to socket">write to socket Command</command>
</references>
<history>
<introduced version="3.5">Added.</introduced>
</history>
<platforms>
<mac/>
<windows/>
<linux/>
<ios/>
<android/>
</platforms>
<classes>
<desktop/>
<server/>
<web/>
<mobile/>
</classes>
<security>
</security>
<summary>Serializes a LiveCode array.</summary>
<examples>
<example>savePreferencesData "displayOptions", arrayEncode(sDisplayOptionsArray)</example>
<example>write urlEncode(arrayEncode(tArray)) to socket tSocket</example>
</examples>
<description>
<p>Use the <b>arrayEncode</b> function to convert an array into a string so that it can be saved to a file or sent across a network.</p><p/><p><b>Parameters:</b></p><p>The <i>array</i> is a LiveCode array.</p><p/><p><b>Value:</b></p><p>The <b>arrayEncode</b> function returns a string of binary data that represents the data and structure of the specified array.</p><p/><p><b>Comments:</b></p><p>The string returned by the <b>arrayEncode</b> function is designed to be used to transfer arrays to remote machines or to save them to a file on disk. It is an opaque, binary encoding of the data contained in the array. The original array can be rebuilt by using the arrayDecode function. Encoded arrays cannot easily be modified, and should always be converted back into real arrays before attemping to access or modify them. </p><p/><p>To send an encoded array to a remote process over TCP/IP, it should be encoded using the <function tag="URLEncode">URLEncode function</function>, as it may contain characters not suitable for use in URLs.</p><p/><p><b>Note:</b> Arrays in LiveCode are un-ordered. This means in particular that encoding two arrays will not necessarily produce the same result, even if the arrays had the same elements. To compare two arrays, simply use the <operator tag="=">= operator</operator> directly on them rather than encoding them first.</p><p/>
</description>
</doc>