J
Jack Leach
Hello, TIA
I'm trying to use my first two-dim array, and seem to be having some trouble
with the syntax.
My goal is to be able to store a list of X and Y dimensions in an array for
a group of points. For example, if I have a 4-point group centered around X0
Y0, with a radius of 1, starting at an angle of 0, I would have the following
four points:
1,0
0,1
-1,0
0,-1
I'm assuming this is what a two-dimensional array is used for, but am not
quite sure how to use it. Declaration of the array? How to set only the
"left" or "right" part of the array? Or am I completely wrong in my
assumtion that this is what we should be using a multidimensional array for?
I've just recently came across a term called a "jagged" array, which
apparently is an array whos elements are also arrays? Perhaps this would be
more apt? ex...
Array1() has two elements: 1,0
Array2() has two elements: 0,1
Array3() has two elements: -1,0
Array4() has two elemants: 0,-1
ArrayParent() has 4 elements, Arrays 1,2,3 and 4?
For those wondering, my ultimate goal here is to come up with some CAM
functions that I can use. Many operations (drilling a hole per say) are done
in repetition. I would like to store the point lists in an array so I can
loop the array and generate the required command at each point. I realize
that I can do this with a delimited list in a string, but would rather avoid
the typecasting and parsing that would be involved.
Many thanks to anyone who can give me some guidance.
--
Jack Leach
www.tristatemachine.com
"I haven''t failed, I''ve found ten thousand ways that don''t work."
-Thomas Edison (1847-1931)
I'm trying to use my first two-dim array, and seem to be having some trouble
with the syntax.
My goal is to be able to store a list of X and Y dimensions in an array for
a group of points. For example, if I have a 4-point group centered around X0
Y0, with a radius of 1, starting at an angle of 0, I would have the following
four points:
1,0
0,1
-1,0
0,-1
I'm assuming this is what a two-dimensional array is used for, but am not
quite sure how to use it. Declaration of the array? How to set only the
"left" or "right" part of the array? Or am I completely wrong in my
assumtion that this is what we should be using a multidimensional array for?
I've just recently came across a term called a "jagged" array, which
apparently is an array whos elements are also arrays? Perhaps this would be
more apt? ex...
Array1() has two elements: 1,0
Array2() has two elements: 0,1
Array3() has two elements: -1,0
Array4() has two elemants: 0,-1
ArrayParent() has 4 elements, Arrays 1,2,3 and 4?
For those wondering, my ultimate goal here is to come up with some CAM
functions that I can use. Many operations (drilling a hole per say) are done
in repetition. I would like to store the point lists in an array so I can
loop the array and generate the required command at each point. I realize
that I can do this with a delimited list in a string, but would rather avoid
the typecasting and parsing that would be involved.
Many thanks to anyone who can give me some guidance.
--
Jack Leach
www.tristatemachine.com
"I haven''t failed, I''ve found ten thousand ways that don''t work."
-Thomas Edison (1847-1931)