You can avoid using Item1, Item2, etc, using the example bellow.
Private Function GetPeStream(metadataDiagnostics As DiagnosticBag, peStreamProvider As EmitStreamProvider, metadataOnly As Boolean) As (peStream As Stream, signingStream As Stream, selectedStream As Stream)
.....
Return (processed_peStream, processed_signingStream,processed_selectedStream)
End Function
Private Function ConsumingGetPeStream()...
'Calling the function
Dim Your_Result_From_GetPeStream = GetPeStream(metadataDiagnostics_value, peStreamProvider_value, metadataOnly_Value)
'Using returned values from function
Your_Result_From_GetPeStream.peStream
Your_Result_From_GetPeStream.signingStream
Your_Result_From_GetPeStream.selectedStream
End Function
A more simple version for better undesrtanding
Public Sub Main()
Dim ReturnFunctionWithTuple = FunctionWithTuple()
Console.WriteLine($"Your long: {ReturnFunctionWithTuple.YourFieldLong}")
Console.WriteLine($"Your date: {ReturnFunctionWithTuple.YourFieldDate}")
Console.WriteLine($"Your bool: {ReturnFunctionWithTuple.YourFiedBoolean}")
End Sub
Public Function FunctionWithTuple() As (YourFieldLong As Long, YourFieldDate As Date, YourFiedBoolean As Boolean)
Return (55, #01/01/2021#, False)
End Function