========================================================================================================================================================================================================================================================================================================================================
Interface with named return values
========================================================================================================================================================================================================================================================================================================================================

interface "Price Calculation"
{
    procedure CountDiscount(ShowAll: Boolean) Result: Integer;
    procedure CountPrice(ShowAll: Boolean) Result: Integer;
    procedure FindDiscount(var TempPriceListLine: Record "Price List Line"; ShowAll: Boolean) Found: Boolean;
    procedure FindPrice(var TempPriceListLine: Record "Price List Line"; ShowAll: Boolean) Found: Boolean;
    procedure IsDiscountExists(ShowAll: Boolean) Result: Boolean;
    procedure IsPriceExists(ShowAll: Boolean) Result: Boolean;
}

--------------------------------------------------------------------------------

(source_file
  (interface_declaration
    (interface_keyword)
    object_name: (quoted_identifier)
    (interface_procedure
      (procedure_keyword)
      name: (identifier)
      (parameter_list
        (parameter
          name: (identifier)
          type: (type_specification
            (basic_type))))
      (interface_procedure_suffix
        return_value: (identifier)
        return_type: (type_specification
          (basic_type))))
    (interface_procedure
      (procedure_keyword)
      name: (identifier)
      (parameter_list
        (parameter
          name: (identifier)
          type: (type_specification
            (basic_type))))
      (interface_procedure_suffix
        return_value: (identifier)
        return_type: (type_specification
          (basic_type))))
    (interface_procedure
      (procedure_keyword)
      name: (identifier)
      (parameter_list
        (parameter
          modifier: (var_keyword)
          name: (identifier)
          type: (type_specification
            (record_type
              reference: (quoted_identifier))))
        (parameter
          name: (identifier)
          type: (type_specification
            (basic_type))))
      (interface_procedure_suffix
        return_value: (identifier)
        return_type: (type_specification
          (basic_type))))
    (interface_procedure
      (procedure_keyword)
      name: (identifier)
      (parameter_list
        (parameter
          modifier: (var_keyword)
          name: (identifier)
          type: (type_specification
            (record_type
              reference: (quoted_identifier))))
        (parameter
          name: (identifier)
          type: (type_specification
            (basic_type))))
      (interface_procedure_suffix
        return_value: (identifier)
        return_type: (type_specification
          (basic_type))))
    (interface_procedure
      (procedure_keyword)
      name: (identifier)
      (parameter_list
        (parameter
          name: (identifier)
          type: (type_specification
            (basic_type))))
      (interface_procedure_suffix
        return_value: (identifier)
        return_type: (type_specification
          (basic_type))))
    (interface_procedure
      (procedure_keyword)
      name: (identifier)
      (parameter_list
        (parameter
          name: (identifier)
          type: (type_specification
            (basic_type))))
      (interface_procedure_suffix
        return_value: (identifier)
        return_type: (type_specification
          (basic_type))))))

================================================================================
Interface with simple return types (existing support)
================================================================================

interface "Simple Returns"
{
    procedure GetCount(): Integer;
    procedure GetName(): Text;
    procedure Calculate(Value: Decimal): Decimal;
}

--------------------------------------------------------------------------------

(source_file
  (interface_declaration
    (interface_keyword)
    object_name: (quoted_identifier)
    (interface_procedure
      (procedure_keyword)
      name: (identifier)
      (interface_procedure_suffix
        return_type: (type_specification
          (basic_type))))
    (interface_procedure
      (procedure_keyword)
      name: (identifier)
      (interface_procedure_suffix
        return_type: (type_specification
          (text_type))))
    (interface_procedure
      (procedure_keyword)
      name: (identifier)
      (parameter_list
        (parameter
          name: (identifier)
          type: (type_specification
            (basic_type))))
      (interface_procedure_suffix
        return_type: (type_specification
          (basic_type))))))

================================================================================
Interface procedures without return types
================================================================================

interface "No Returns"
{
    procedure Init(LineWithPrice: Interface "Line With Price"; PriceCalculationSetup: Record "Price Calculation Setup");
    procedure GetLine(var Line: Variant);
    procedure ApplyDiscount();
    procedure ApplyPrice(CalledByFieldNo: Integer);
}

--------------------------------------------------------------------------------

(source_file
  (interface_declaration
    (interface_keyword)
    object_name: (quoted_identifier)
    (interface_procedure
      (procedure_keyword)
      name: (identifier)
      (parameter_list
        (parameter
          name: (identifier)
          type: (type_specification
            (object_reference_type
              object_type: (interface_keyword)
              reference: (quoted_identifier))))
        (parameter
          name: (identifier)
          type: (type_specification
            (record_type
              reference: (quoted_identifier)))))
      (interface_procedure_suffix))
    (interface_procedure
      (procedure_keyword)
      name: (identifier)
      (parameter_list
        (parameter
          modifier: (var_keyword)
          name: (identifier)
          type: (type_specification
            (basic_type))))
      (interface_procedure_suffix))
    (interface_procedure
      (procedure_keyword)
      name: (identifier)
      (interface_procedure_suffix))
    (interface_procedure
      (procedure_keyword)
      name: (identifier)
      (parameter_list
        (parameter
          name: (identifier)
          type: (type_specification
            (basic_type))))
      (interface_procedure_suffix))))
