Basic array question.

I am trying to figure out how to use arrays.
The manuals are very confusing (for me) about this topic.

As an example, I would like to store some numbers in an array to use for offsetting from a position.

PERS num nMyArray{2,3}:=[[1,2],[3,4],[5,6]];
CONST robtarget centerpos:=[[-490.16,1517.62,1804.67],[0.262408,-0.265629,-0.646938,0.664872],[1,0,-1,1],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];

PROC main()
  spraypos:=Offs(centerpos, **row***12.7, **column***12.7, 0);
  MoveL spraypos, v400, fine, t_spray;
ENDPROC

In the example above, I want to offset the robtarget centerpos by calling the data from the array to replace row and column.

How do I format the syntax to make that happen?
If I wanted to replace row with 5 and column with 2 how do I code that?

Give this a shot:

MODULE mArrays

PERS num nMyArray{3,2}:=[[1,2],[3,4],[5,6]];
CONST robtarget centerpos:=[[-490.16,1517.62,1804.67],[0.262408,-0.265629,-0.646938,0.664872],[1,0,-1,1],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];

VAR robtarget spraypos;
VAR tooldata t_spray;
VAR num row;
VAR num column;

PROC main()
row:=nMyArray{3,1};
column:=nMyArray{3,2};
TPErase;
TPWrite "Row = “+NumToStr(row,0)+” Column = "+NumToStr(column,0);
!spraypos:=Offs(centerpos, row12.7, column12.7, 0);
!MoveL spraypos, v400, fine, t_spray;
ENDPROC

ENDMODULE

Thank you very much! Most of the mystery has been solved.
Now I just need to figure out how to define and index a 3D array :smiley: