Author Topic: Bug with function with return value  (Read 1353 times)

Víctor R. Ruiz

  • Administrator
  • Jr. Member
  • *****
  • Posts: 91
    • View Profile
Bug with function with return value
« on: 2016-January-12 04:55:16 pm »
I'm investigating a problem with a function that returns a value. When a function is defined with a parameter, and the parameter is returned as a value, the generated code is not correct (it returns no value).

Víctor R. Ruiz

  • Administrator
  • Jr. Member
  • *****
  • Posts: 91
    • View Profile
Re: Bug with function with return value
« Reply #1 on: 2016-January-21 01:14:56 pm »
The problem is that an exception is throw when the parameter is used as a return value. returnValue is not defined in RoboBlocks.variables[]:

Code: [Select]
                } else if (this.isVariable(returnValue)) {
                    returnType = RoboBlocks.variables[returnValue][0];