Compiler Error C0454
Message: It is not possible to use an assignment expression with the __NEW operator in another expression. Use the pointer variable instead.
Possible error cause: An assignment with the __NEW operator is used directly in a test against 0.
Error correction: Use the assignment as a standalone statement. Use the POINTER variable in the condition of the IF statement.
Example of the error:
PROGRAM MAIN
VAR
pSt: POINTER TO ST_Data;
END_VAR
IF (pSt := __NEW(ST_Data)) = 0 THEN
RETURN;
END_IFMessage:
C0454: It is not possible to use an assignment expression with the __NEW operator in another expression. Use the pointer variable instead.
Example of an error correction:
PROGRAM MAINVAR
pSt: POINTER TO ST_Data;
END_VAR
pSt := __NEW(ST_Data);
IF pSt = 0 THEN
RETURN;
END_IF