|
|
|
SWU_tclArrayToCArraySWU_listToCArray is a library procedure which allows users to convert Tcl array to a C array of type long, float, integer, or double. The input data is the Tcl array's name and the requested C numeric type (long, float, integer, or double). It is important to note that although Tcl array indices can consist of any string value, C array indices are represented by consecutive integers beginning with 0. For example, consider a 3-element Tcl array with indices "Peter, Paul, Mary". Perhaps each element of the array consists of the individual's age. The resulting C array will simply use the (less informative) indices "0, 1, 2" to point to the element containing the age of each of the individuals. package require SWU SWU_tclArrayToCArray Tcl_array_name C_numeric_type
Return ValueIf the procedure succeeds then it returns the ID of a C array filled with values of the Tcl array's elements, otherwise an error message string is returned on the Tk console's command line. Side EffectsNone. Examples
This example sets varArray to an array of numbers, converts the varArray to a C array of type float, prints out the fourth element of the C array. See Also |
|
copyright Video-Collage Inc. |