Multidimensional arrays
Hi all,
I'm currently trying to read one dimension of a multi-dimensional array and write it to a dimension of another multi-dimensional variable.
Example
READING the first dimension of nZone1PckTab
Local PERS num nZone1PckTab{2,3,2}:=[[[0,0],[0,0],[2,2]],[[0,0],[0,0],[2,2]]];
WRITING it to the first dimension of nCtxZone1PckTab
PERS num nCtxZone1PckTab{3,3,2}:=[[[0,0],[0,0],[2,2]],[[0,0],[0,0],[2,2]],[[0,0],[0,0],[2,2]]];
Question :
1- Is there any way of retrieving just one dimension in a multi-dimensional array ? (I suppose no since ReadItem seems not to accept this) Or I have to do it manually ?
2- Is there any way of getting the number of items in each dimension (I could not find this anywhere, and it does not appear in the help of RAP5.07, but it would be very very useful !!!)
Regards to all,
Antoine
I'm currently trying to read one dimension of a multi-dimensional array and write it to a dimension of another multi-dimensional variable.
Example
READING the first dimension of nZone1PckTab
Local PERS num nZone1PckTab{2,3,2}:=[[[0,0],[0,0],[2,2]],[[0,0],[0,0],[2,2]]];
WRITING it to the first dimension of nCtxZone1PckTab
PERS num nCtxZone1PckTab{3,3,2}:=[[[0,0],[0,0],[2,2]],[[0,0],[0,0],[2,2]],[[0,0],[0,0],[2,2]]];
Question :
1- Is there any way of retrieving just one dimension in a multi-dimensional array ? (I suppose no since ReadItem seems not to accept this) Or I have to do it manually ?
2- Is there any way of getting the number of items in each dimension (I could not find this anywhere, and it does not appear in the help of RAP5.07, but it would be very very useful !!!)
Regards to all,
Antoine
0
Comments
-
Hi again,
Otherwise the only solutions I have is to manipulate strings, manually calculate dimensions. This is both very inefficient in terms of string manipulations when you have a lot of variables to deal with, and time consuming for writing the code.
It seems incredible to me not to have access to such basic properties that give the dimensions and number of elements of arrays as available with WebWare SDK (S4Array when using multidimensional arrays - NumDimensions and ElementSize methods).
Will this feature be enabled in RAB 5.07 ?
Regards,
Antoine0
Categories
- All Categories
- 5.5K RobotStudio
- 396 UpFeed
- 18 Tutorials
- 13 RobotApps
- 297 PowerPacs
- 405 RobotStudio S4
- 1.8K Developer Tools
- 250 ScreenMaker
- 2.8K Robot Controller
- 314 IRC5
- 60 OmniCore
- 7 RCS (Realistic Controller Simulation)
- 794 RAPID Programming
- AppStudio
- 3 RobotStudio AR Viewer
- 18 Wizard Easy Programming
- 105 Collaborative Robots
- 5 Job listings