| 1 |
|
| 2 |
<refentry id="reshapearray"> |
| 3 |
<indexterm id="IndexReshapearray"><primary>reshapearray</primary></indexterm> |
| 4 |
|
| 5 |
<refentryinfo><title>Array Opcodes</title></refentryinfo> |
| 6 |
<refmeta> |
| 7 |
<refentrytitle>reshapearray</refentrytitle> |
| 8 |
</refmeta> |
| 9 |
|
| 10 |
<refnamediv> |
| 11 |
<refname>reshapearray</refname> |
| 12 |
<refpurpose> |
| 13 |
Reshape an array, maintaining its capacity |
| 14 |
</refpurpose> |
| 15 |
</refnamediv> |
| 16 |
|
| 17 |
<refsect1> |
| 18 |
<title>Description</title> |
| 19 |
<para>Plugin opcode in emugens.</para> |
| 20 |
<para> |
| 21 |
The <emphasis>reshapearray</emphasis> opcode changes the shape of an |
| 22 |
array, as long as this does not modify its capacity. It can |
| 23 |
be used to convert a 1D to a 2D array, or viceversa, or simply |
| 24 |
to modify the size of its dimensions, as long as the product |
| 25 |
remains constant. |
| 26 |
</para> |
| 27 |
</refsect1> |
| 28 |
|
| 29 |
<refsect1> |
| 30 |
<title>Syntax</title> |
| 31 |
|
| 32 |
<synopsis><command>reshapearray</command> array[], isize0 [, isize1 ]</synopsis> |
| 33 |
</refsect1> |
| 34 |
|
| 35 |
<refsect1> |
| 36 |
<title>Initialization</title> |
| 37 |
<para> |
| 38 |
<emphasis>array[]</emphasis> - The array to be reshaped (this is done inplace) |
| 39 |
</para> |
| 40 |
<para> |
| 41 |
<emphasis>isize0</emphasis> - The size of the first dimension |
| 42 |
</para> |
| 43 |
<para> |
| 44 |
<emphasis>isize1</emphasis> - The size of the second dimension (0 for 1D arrays). <emphasis>Defaults to 0</emphasis> |
| 45 |
</para> |
| 46 |
</refsect1> |
| 47 |
|
| 48 |
<refsect1> |
| 49 |
|
| 50 |
|
| 51 |
|
| 52 |
<title>Examples</title> |
| 53 |
<para> |
| 54 |
Here is an example of the reshapearray opcode. It uses the file <ulink url="examples/reshapearray.csd"><citetitle>reshapearray.csd</citetitle></ulink>. |
| 55 |
<example> |
| 56 |
<title>Example of the reshapearray opcode.</title> |
| 57 |
<xi:include href="examples-xml/reshapearray.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/> |
| 58 |
</example> |
| 59 |
</para> |
| 60 |
</refsect1> |
| 61 |
|
| 62 |
<refsect1> |
| 63 |
<title>See also</title> |
| 64 |
<para><link linkend="arrayOpcodes"><citetitle>Array opcodes</citetitle></link></para> |
| 65 |
</refsect1> |
| 66 |
|
| 67 |
<refsect1> |
| 68 |
|
| 69 |
<title>Credits</title> |
| 70 |
<para>By: &nameeduardo; 2018</para> |
| 71 |
<para>New plugin in version 6.12</para> |
| 72 |
</refsect1> |
| 73 |
|
| 74 |
|
| 75 |
|
| 76 |
|
| 77 |
|
| 78 |
|
| 79 |
</refentry> |