RobotStudio event

Syntax Error - RS Online

I was trying to pass an array of robtargets to a procedure, but I was getting a syntax error from the program editor when passing multiple arguments.  To simplify this, I tried the following example from Section 22.4 Routine Declarations of the Rapid Overview manual:

%%%
   VERSION: 1
   LANGUAGE: ENGLISH
%%%

MODULE Module1
 VAR num globalarray{9}:=[1,2,3,4,5,6,7,8,9];
 
PROC arrmul(VAR num array{*},num factor)
 FOR index FROM 1 TO dim(array,1) Do
  array{index}:=array{index}*factor;
 ENDFOR
ENDPROC
PROC main()
 arrmul(globalarray,5);
ENDPROC

ENDMODULE

When applying the changes, RS Online gave the following error messages:

/T_ROB1/Module1/(14):Error 40135:Syntax error.:Expected ')

/T_ROB1/Module1/(14):Error 40136:Syntax error: Unexpected ')'

I have tried a variety of variable declarations with no change in the results.  I am using RS 5.7.1834.1023 and RS Online 5.7.1025.0

Any help would allow me to keep my remaining strands of hair.

Thanks,

Jim Haglund

Comments


  • Hi Jim,

    It's your procedure call that is incorrect; procedures don't use parentheses:

    PROC main()
     arrmul globalarray,5;
    ENDPROC

    Johannes Weiman2006-10-26 9:19:24
    Johannes Weiman
    Software Engineer
    ABB Robotics
  • Thanks, that was it.  I figured it was something simple, but I sure couldn't see it.
    Jim Haglund