# Using struct in function

**URL:** <https://forum.legato.io/t/using-struct-in-function/6119>\
**Category:** Uncategorized\
**Created:** [February 23, 2022, 7:12am UTC](https://forum.legato.io/t/using-struct-in-function/6119 "2022-02-23T07:12:47Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![jyijyi](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/jyijyi/32/822_2.png) [@jyijyi](https://forum.legato.io/u/jyijyi)\
**Post date:** [February 23, 2022, 7:27am UTC](https://forum.legato.io/t/using-struct-in-function/6119/4 "2022-02-23T07:27:44Z")

</div>

you can try the sample code here:

> [@In legato 19.02 api is not supporting more than 2 string](https://forum.legato.io/t/in-legato-19-02-api-is-not-supporting-more-than-2-string/5716/2):
>
> how about making the API file like this? STRUCT ARRAY123 { string Array1[10]; int32 port1; string Array2[10]; int32 port2; string Array3[10]; int32 port3; string Array4[10]; int32 port4; string Array5[10]; int32 port5; }; FUNCTION arraySend ( ARRAY123 asd IN ); It is working on my side with vscode leaf swi-wp76\_4.7.0. You can use my code: [IPC\_step1.rar](https://forum.legato.io/uploads/short-url/dgUwkVXIXDa6sS6CbPxzjqn2x7a.rar) (2.4 KB)

---

_[View the full topic](https://forum.legato.io/t/using-struct-in-function/6119)._
