CFunction.SetArray
------------------

Sets values of an array.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [CFunction](component_CFunction.md) | [10.3](newinversion103.md) | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |

MBS( "CFunction.SetArray"; FunctionRef; Index; Type; List ) 

**MBS**( **"CFunction.SetArray";** /\* Sets values of an array. \*/  
**$FunctionRef**; /\* The reference number for the function.e.g. $func \*/   
**$Index**; /\* The index for the parameter.  
Range is 0 to [CFunction.ParameterCount](CFunctionParameterCount.md)-1.e.g. 0 \*/   
**$Type**; /\* The data type to use.e.g. "f" \*/   
**$List**) /\* The list of values.e.g. "1¶2¶3" \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| FunctionRef | The reference number for the function. | $func |
| Index | The index for the parameter.   Range is 0 to [CFunction.ParameterCount](CFunctionParameterCount.md)-1. | 0 |
| Type | The data type to use. | "f" |
| List | The list of values. | "1¶2¶3" |

### Result

Returns OK or error.

### Description

Sets values of an array.  
Please pass a list of values to fill the array.   
See table below for valid types.  
  
| Type | Name | Size | Description |
|---|---|---|---|
| B | BOOL | 4 | Boolean value |
| c | char | 1 | signed 8 bit value |
| C | unsigned char | 1 | unsigned 8 bit value |
| s | short | 2 | signed 16 bit value |
| S | unsigned short | 2 | unsigned 16 bit value |
| i | int | 4 | signed 32 bit value |
| I | unsigned int | 4 | unsigned 32 bit value |
| j | long | 4 or 8 | for Windows 32-bit value, for MacOS and Linux 64-bit value |
| J | unsigned long | 4 or 8 | for Windows 32-bit value, for MacOS and Linux 64-bit value |
| l | long long | 8 | signed 64 bit value |
| L | unsigned long long | 8 | unsigned 64 bit value |
| f | float | 4 | floating point number in 32-bit size |
| d | double | 8 | floating point number in 64-bit size |
| p | pointer | 4 or 8 | pointer in 32 or 64-bit. |

### Examples

Set array of float values:

 MBS ( "CFunction.SetArray"; $function ; 0; "f"; 1 &amp; ¶ &amp; 2 &amp; ¶ &amp; 3 )  
### See also

- [CFunction.Call](CFunctionCall.md)
- [CFunction.FreeArray](CFunctionFreeArray.md)
- [CFunction.GetArray](CFunctionGetArray.md)
- [CFunction.ParameterCount](CFunctionParameterCount.md)
- [CFunction.SetTag](CFunctionSetTag.md)

### Blog Entries

- [Calling C functions from FileMaker](https://www.mbsplugins.de/archive/2024-01-09/Calling_C_functions_from_FileM/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 25th April 2020 , last changed 25th April 2020

  
[CFunction.ReturnType](CFunctionReturnType.md) - [CFunction.SetTag](CFunctionSetTag.md)

[HTML Version](CFunctionSetArray.shtml)