next up previous contents
Next: 2.4.5 CURRENCY type Up: 2.4 Type Conversion Previous: 2.4.3 Pointers to IUnknown   Contents

2.4.4 Arrays and Tables

LuaCOM converts Lua tables to SAFEARRAY's and vice-versa. To be converted, Lua tables must be ``array-like'', that is, all of its elements must be or ``scalars'' or tables of the same length. These tables must also be ``array-like''. Here are some samples of how is this conversion done:
Lua table Safe Array
table = {"name", "phone"}

\begin{displaymath}
\left[\begin{array}{cc}
''name'' & ''phone'' \\
\end{array}\right]
\end{displaymath}

table = {{1,2},{4,9}}

\begin{displaymath}
\left[\begin{array}{cc}
1 & 2 \\
4 & 9 \\
\end{array} \right]
\end{displaymath}



Vinicius da Silva Almendra 2003-06-27