Skip to content

Latest commit

 

History

History
16 lines (10 loc) · 932 Bytes

File metadata and controls

16 lines (10 loc) · 932 Bytes

Iec022 - Return types must not be Any or IecString or user structure

Severity: Error Error

Return types of IEC methods/functions must not be of the type Any, IecStringEx, IecString80, IecWString or IecWString80 or a user type (structs attributed with [Structure], [Array] or [String]). IEC methods/functions that can have return values are methods that either:

  • have the attribute [User]
  • have the attribute [Execution], are called __Process and are in a class with the attribute [Function]
  • have the attribute [Function] and are in a class with the attribute [FunctionContainer]

Solution

You can also use the provided automatic Code Fix to convert the return type into an [Output] ref parameter. ( Press Alt + Enter on the Error line to find the Code Fix in the context menu)

Convert the return to a parameter attributed with [Output] ref.