Skip to main content

Compiler Error C0185

Message: It is not possible to perform component access '.', index access '[]' or call '()' on result of function call. Assign result to help variable first.

Possible error cause: Component or index access to the result of a function call is performed.

Error correction: Assign the result to a variable in order to access.

Example 419. Example of the error:
PROGRAM PLC_PRG
VAR
    it : ITF;
END_VAR

POU_1()[0].METH1();

FUNCTION POU_1 : ARRAY[0..0] OF ITF

INTERFACE ITF

METHOD METH1

Message:

C0185: It is not possible to perform component access '.', index access '[]' or call '()' on result of function call. Assign result to help variable first.