dotnet / dotnet/vblang

Proposal: Better support for Out Parameters by introducing Out Variables

Open
#60 3 comments 0 reactions 0 assignees View on GitHub
Proposal
Dominant language
No language data
Stars
328
Forks
71
PR merge metrics
No merged PRs in 30d

Description

C# got Out Variables in 7.0 - [Mads wrote about here](https://blogs.msdn.microsoft.com/dotnet/2017/03/09/new-features-in-c-7-0/).

Out Variables would extend the usage of "As Type" ([see here](https://github.com/dotnet/vblang/issues/59)) by an additional scenario in VB. When using Out Parameters, we would not need to declare the Out Parameter Variable beforehand, but could use it like this:

```
Dim intAsString = "314159"

'An Out Variable would be declared and passed to the method in one go.
Dim boolResult = Integer.TryParse(intAsString, intResult As Integer)

'And it would be used it in the same scope.
intResult = intresult * 2
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.