RobotStudio event

Can not call a procedure with more than one argument

Hello guys, everytime when i try in rapid to call a procedure with more than one argument, the compiler tells me there is a syntax error and expects a bracket. Simple Example: [code] PROC test (var num a, var num b) VAR num c; c:=a; a:=b; b:=c; ENDPROC [/code] calling in main doesent work because of syntax error: [code] var num a:=3; var num a:=4; test(a,b); [/code] What do I overlook? What syntax error? How to fix it? The procedure is declared out of the main procedure in module. Thnx.

Comments

  • If you call a proc the call is test a,b and if you call a func it's test(a,b) could be the issue
    Per Svensson
    Robotics and Vision Specialist
    Consat Engineering
  • Hi Per, thnx for your tip, but your instruction doesnt work. The manual example is more similar to my procedure example. I also tried to call a funciton (FUNC) but the same problem. Compiler says syntax error. The only way I see now, is to use global variables. But it doesnt solve my problem.
  • You can not use the name test it is a rapid command
    Regards
    Knud Erik Lindberg
    Jorgensen Engineering
  • Hi Knud, yes I know. Its only a code example. My procedures had other names and they weren't underlined by the compiler, instead the instruction for calling the procedure was marked as a syntax error. I dont know why.
  • Is something like this
    Per Svensson
    Robotics and Vision Specialist
    Consat Engineering
  • Hi Per, thnx. The brackets had to be missing. So you was right.