Hi all,
Is it possible to convert a JS Array to an SC Array?
If so, what is the syntax please.
Cheers
Hi all,
Is it possible to convert a JS Array to an SC Array?
If so, what is the syntax please.
Cheers
Why do you need to convert it? If the array is what you're returning to an SC function (or setting in a RAD variable), you can return a JS Array and it will be implicitly converted.
Hiya glg,
I had an idea on some coding that I was doing and wasn't too sure if you can only use JS funcitons on JS datums and SC functions on SC datums.
If that was the case I was converting an SC array to a JS array, manipulating the values and then realised that I needed to use an SC function. So I thought I'd have to convert it back to an SC array and do the SC functions.
Is this not the case?
Cheers
Nope, if the JS array is "homogenic" and the data type for items hasn't changed
plain assignment should do the trick.
i.e. probsum.assignment = jsAssignmentArr;
Hi Mateuszk,
Thanks for the reply but it made no sense to meEven looking up the word "homogenic" the result was an album from Bjork hee hee.
Can you please explain that in "layman's terms"
Cheers
Sure, using that word might be too much, you're right.
http://www.merriam-webster.com/medical/homogenic
What I meant is, when an array has all the items of the same type (String, Number etc.).
In SC/SM an array can't have mixed types, in JS no problem.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks