You attempted to assign a value to a function result. The result of a function can be assigned to a variable, but it cannot be used as a variable. If you want to assign a new value to the function itself, omit the parentheses (the function call operator). The following example demonstrates a situation in which this error is generated.

 CopyCode imageCopy Code
myFunction() = 42;  // Attempting to assign the value 42 to the result of the function call.

To correct this error

  • Do not use the value of a function call result as something you can assign to. You can assign the result of the function call to a variable though.

     CopyCode imageCopy Code
    myVar = myFunction(42);
  • Alternatively, you can assign the function itself (and not its return value) to a variable.

     CopyCode imageCopy Code
    myFunction = new Function("return 42;");

See Also

In Vbsedit, you only need to press F1 to get Help for the keyword under the cursor!


Download Now!



Download   Home  

Copyright © 2001-2024 adersοft