Typed Arrays in Servoy

Questions and answers on designing your Servoy solutions, database modelling and other 'how do I do this' that don't fit in any of the other categories

Typed Arrays in Servoy

Postby habib » Fri Jul 06, 2018 7:40 pm

Hi,

Is it possible to use typed arrays like Uint8Array when filling out javascript files in servoy?
habib
 
Posts: 6
Joined: Wed Jul 04, 2018 10:11 pm

Re: Typed Arrays in Servoy

Postby ROCLASI » Fri Jul 06, 2018 11:32 pm

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.
Robert Ivens
SAN Developer / Servoy Valued Professional / Servoy Certified Developer

ROCLASI Software Solutions / JBS Group, Partner
Mastodon: @roclasi
--
ServoyForge - Building Open Source Software.
PostgreSQL - The world's most advanced open source database.
User avatar
ROCLASI
Servoy Expert
 
Posts: 5438
Joined: Thu Oct 02, 2003 9:49 am
Location: Netherlands/Belgium

Re: Typed Arrays in Servoy

Postby habib » Mon Jul 09, 2018 2:53 pm

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!
habib
 
Posts: 6
Joined: Wed Jul 04, 2018 10:11 pm

Re: Typed Arrays in Servoy

Postby Joas » Thu Jul 19, 2018 7:23 am

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.
Joas de Haan
Yield Software Development
Need help on your project? yieldsd.com
User avatar
Joas
Site Admin
 
Posts: 842
Joined: Mon Mar 20, 2006 4:07 pm
Location: Leusden, NL


Return to Programming with Servoy

Who is online

Users browsing this forum: No registered users and 10 guests