Void functions are not supposed to return values (W1023)

Doing an update from Citect Scada V7.2 till 2018R2.
During compiling I get the following warning:

Void functions are not supposed to return values (W1023)

It seems that all the "Return -1" that are used inside the Cicode Editor is the cause. Is it possible to get rid off these warnings?

Example:

If Something then

Some = 5
RETURN -1

END

Parents
  • Peter is right,

    Everytime you need to RETURN an integer value from a function, that function needs to be declared as INT FUNCTION F_name().

    You are missing the INT declaration, making it a void function that cannot return a value.

    If you want to exit from a void function, you may use the RETURN statement without a value behind it.

    Regards,

    Patrick

Reply
  • Peter is right,

    Everytime you need to RETURN an integer value from a function, that function needs to be declared as INT FUNCTION F_name().

    You are missing the INT declaration, making it a void function that cannot return a value.

    If you want to exit from a void function, you may use the RETURN statement without a value behind it.

    Regards,

    Patrick

Children
No Data