# RegWriteStringArray

int RegWriteStringArray (unsigned int rootKey, const char subkeyName[], int numberOfItems, const char *arrayOfValueNames[], const char *arrayOfStringBuffer[]);

## Purpose

This function writes an array of NUL–terminated ASCII strings to the specified Key Values in the Windows Registry. You must specify a Root Key, a Subkey of that Root Key, and names of the actual Values of that Subkey to which you want to write the data.

Example:

static char *valueNames[]={"MyFirstValue",NULL,"MySecondValue"};
static char *values[]={"String1","DefaultValue","String2"};

RegWriteStringArray (REGKEY_HKLM, "Software\\MySubKey", 3, valueNames, values);

## Parameters

Input
Name | Type | Description
rootKey | unsigned integer | The Root Key under which you wish to access a Subkey and its value. See the Windows Registry functions Class help for more information on Root Keys.
subkeyName | const char [] | The name of the Subkey (relative to the Root Key), to which you want to write value data. See the Windows Registry functions Class help for more information on Subkeys.
numberOfItems | integer | The number of names and values which you want to write to the Windows Registry.
arrayOfValueNames | const char * [] | The array of names of the values to which you want to write data. If any value name does not exist this function will create it. An array element may contain NULL or an empty string if you want to write to the Key's Default Value. See the Windows Registry functions Class help for more information on Key Values.
arrayOfStringBuffer | const char * [] | The array of the NULL–terminated ASCII strings you wish to write to the specified Values of the specified Subkey.

## Return Value

Name | Type | Description
status | integer | The status code that the function returns. 0 indicates success. A negative value indicates an error. This function may return a Programmer's Toolbox or UI Library error code. Call GetGeneralErrorString to obtain a text description of the error.