RobotStudio event

RAPID arrays

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

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?
  • 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?
  • 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.