Page 1 of 1
Typed Arrays in Servoy
Posted:
Fri Jul 06, 2018 7:40 pm
by habib
Hi,
Is it possible to use typed arrays like Uint8Array when filling out javascript files in servoy?
Re: Typed Arrays in Servoy
Posted:
Fri Jul 06, 2018 11:32 pm
by ROCLASI
Hi Habib,
JavaScript is not a strong typed language (unlike TypeScript) but you can do things like:
- Code: Select all
/** @type {Array<Integer>} */
var myArray = [];
And developer will give you markers if you use it with anything else than integers.
Hope this helps.
Re: Typed Arrays in Servoy
Posted:
Mon Jul 09, 2018 2:53 pm
by habib
Hi,
What i want to do is use a Uint8Array/ArrayBuffer to hold data converted from base64 form. Is there any way i can do something like that?
Thanks!
Re: Typed Arrays in Servoy
Posted:
Thu Jul 19, 2018 7:23 am
by Joas
Uint8Array and ArrayBuffer are newer types of arrays that are not available in the javascript version that Servoy uses.
A normal array can hold the data that you want though, but it doesn't prevent you from adding values of different types.