RAPID arrays
msalminen
✭✭
Hi,
Is it possible to define RAPID array dimension by using variables?
Seems to me that array dimension have to be constant and so to be known beforhand.
Example:
I want define array by the routine call parameter
PERS num arrDim:=5;
PROC MyRoutine(num arrDim)
VAR string MyArray{arrDim};
but here I get error that arrDim is not constant. So I can't chage arrray size as needed
Is there a way to define 'dynamically' arrays dimension?
Regards,
Mika
0
Comments
-
i have run into this before, and never figured out a way around it. Always ended up declaring "larger than i would ever need arrays"A?0
-
Hi guys,This is an old question but I'm actually facing the same problem right now. Does anyone have a solution to it yet?0
-
Yep,Looking at the date, this might be solved already but for others crossing this situation:you should be able to assing a CONST num variable to the array size. If you do this, you just have to change the value of the CONST num if you want another size array.You cannot change CONST vars at run time though, so if you want another array you should change the CONST value at the start of the program.Also, as far as I know it is not possible to define arrays dynamically.Hope this helps you out a little.0
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
- 316 IRC5
- 61 OmniCore
- 7 RCS (Realistic Controller Simulation)
- 800 RAPID Programming
- AppStudio
- 3 RobotStudio AR Viewer
- 18 Wizard Easy Programming
- 105 Collaborative Robots
- 5 Job listings