Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape.
First time visiting? Here are some places to start:- Looking for a certain topic? Check out the categories filter or use Search (upper right).
- Need support? Ask a question to our Community Support category.
- Please submit support tickets for bugs but you can request improvements in the Product Feedback category.
- Be respectful, on topic and if you see a problem, Flag it.
If you would like to contact our Community Manager personally, feel free to send a private message or an email.
notation to acces section/part of an array
otaolafr
Member Posts: 113 EDU
hello,
I am trying to recover a part of an array,
for example
var x = [1,2,3,4,5,6] // x is [1,2,3,4,5,6]
how can for example extract the array of the two elements from the third to the fith
something like:
var partX= x[2..4] // partX is [3,4,5]
I tried x[2..4] , x[2:4] without luck
I couldn't find this in the documentation (at least here https://cad.onshape.com/FsDoc/variables.html#array)
I am trying to recover a part of an array,
for example
var x = [1,2,3,4,5,6] // x is [1,2,3,4,5,6]
how can for example extract the array of the two elements from the third to the fith
something like:
var partX= x[2..4] // partX is [3,4,5]
I tried x[2..4] , x[2:4] without luck
I couldn't find this in the documentation (at least here https://cad.onshape.com/FsDoc/variables.html#array)
Tagged:
0
Comments
https://cad.onshape.com/FsDoc/library.html#subArray-array-number-number