dotnet / dotnet/vblang

Proposal: With block with variable declaration to allow local scope and object Ref

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

Description

Combining this https://github.com/dotnet/vblang/issues/437#issuecomment-490632543 with this https://github.com/dotnet/vblang/issues/393
We can have a new local scope like this:
```VB.NET
If condition Then
Dim x = 1
End If

With X = "Test"
' This is a local scope to use X
End With

With X As Integer = 0
' This is a local scope to use X
End With

With X = Form1
' use X as a ref for Form1
X.Show()
` or use the . directly
.Hide()
End With

```

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.