-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix loop counter and add project files
- Loading branch information
Showing
10 changed files
with
127 additions
and
107 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
Example.RunIt(); | ||
Example1.RunIt(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
<TargetFramework>net8.0</TargetFramework> | ||
</PropertyGroup> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
snippets/visualbasic/VS_Snippets_CLR_System/system.Array.Clear/vb/Program.vb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
Public Class Program | ||
Public Shared Sub Main() | ||
Example.RunIt() | ||
'Example1.RunIt() | ||
End Sub | ||
End Class |
8 changes: 8 additions & 0 deletions
8
snippets/visualbasic/VS_Snippets_CLR_System/system.Array.Clear/vb/Project.vbproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
<TargetFramework>net8.0</TargetFramework> | ||
</PropertyGroup> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 28 additions & 29 deletions
57
snippets/visualbasic/VS_Snippets_CLR_System/system.Array.Clear/vb/example.vb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,102 +1,101 @@ | ||
' <Snippet1> | ||
Module Example | ||
Sub Main() | ||
Sub RunIt() | ||
Console.WriteLine(vbLf & "One dimension (Rank=1):") | ||
Dim numbers1() As Integer = {1, 2, 3, 4, 5, 6, 7, 8, 9} | ||
|
||
For i As Integer = 0 To 8 | ||
Console.Write("{0} ", numbers1(i)) | ||
Next | ||
Next | ||
Console.WriteLine() | ||
|
||
Console.WriteLine(vbLf & "Array.Clear(numbers1, 2, 5)") | ||
Array.Clear(numbers1, 2, 5) | ||
|
||
For i As Integer = 0 To 8 | ||
Console.Write("{0} ", numbers1(i)) | ||
Next | ||
Next | ||
Console.WriteLine() | ||
|
||
|
||
Console.WriteLine(vbLf & "Two dimensions (Rank=2):") | ||
Dim numbers2(,) As Integer = {{ 1, 2, 3 }, { 4, 5, 6 }, { 7, 8, 9 }} | ||
Dim numbers2(,) As Integer = {{1, 2, 3}, {4, 5, 6}, {7, 8, 9}} | ||
|
||
For i As Integer = 0 To 2 | ||
For j As Integer = 0 To 2 | ||
Console.Write("{0} ", numbers2(i, j)) | ||
Next | ||
Next | ||
Console.WriteLine() | ||
Next | ||
Next | ||
|
||
Console.WriteLine(vbLf & "Array.Clear(numbers2, 2, 5)") | ||
Array.Clear(numbers2, 2, 5) | ||
|
||
For i As Integer = 0 To 2 | ||
For j As Integer = 0 To 2 | ||
Console.Write("{0} ", numbers2(i, j)) | ||
Next | ||
Next | ||
Console.WriteLine() | ||
Next | ||
|
||
Next | ||
|
||
Console.WriteLine(vbLf & "Three dimensions (Rank=3):") | ||
Dim numbers3(,,) As Integer = {{{ 1, 2 }, { 3, 4 }}, _ | ||
{{ 5, 6 }, { 7, 8 }}, _ | ||
{{ 9, 10 }, { 11, 12 }}} | ||
Dim numbers3(,,) As Integer = {{{1, 2}, {3, 4}}, | ||
{{5, 6}, {7, 8}}, | ||
{{9, 10}, {11, 12}}} | ||
|
||
For i As Integer = 0 To 1 | ||
For i As Integer = 0 To 2 | ||
For j As Integer = 0 To 1 | ||
For k As Integer = 0 To 1 | ||
Console.Write("{0} ", numbers3(i, j, k)) | ||
Next | ||
Next | ||
Console.WriteLine() | ||
Next | ||
Next | ||
Console.WriteLine() | ||
Next | ||
Console.WriteLine() | ||
|
||
Next | ||
|
||
Console.WriteLine("Array.Clear(numbers3, 2, 5)") | ||
Array.Clear(numbers3, 2, 5) | ||
|
||
For i As Integer = 0 To 1 | ||
For i As Integer = 0 To 2 | ||
For j As Integer = 0 To 1 | ||
For k As Integer = 0 To 1 | ||
Console.Write("{0} ", numbers3(i, j, k)) | ||
Next | ||
Next | ||
Console.WriteLine() | ||
Next | ||
Next | ||
Console.WriteLine() | ||
Next | ||
Next | ||
End Sub | ||
End Module | ||
|
||
' The example displays the following output: | ||
' One dimension (Rank=1): | ||
' 1 2 3 4 5 6 7 8 9 | ||
' | ||
' | ||
' Array.Clear(numbers1, 2, 5) | ||
' 1 2 0 0 0 0 0 8 9 | ||
' | ||
' | ||
' Two dimensions (Rank=2): | ||
' 1 2 3 | ||
' 4 5 6 | ||
' 7 8 9 | ||
' | ||
' | ||
' Array.Clear(numbers2, 2, 5) | ||
' 1 2 0 | ||
' 0 0 0 | ||
' 0 8 9 | ||
' | ||
' | ||
' Three dimensions (Rank=3): | ||
' 1 2 | ||
' 3 4 | ||
' | ||
' 5 6 | ||
' 7 8 | ||
' | ||
' | ||
' Array.Clear(numbers3, 2, 5) | ||
' 1 2 | ||
' 0 0 | ||
' | ||
' | ||
' 0 0 | ||
' 0 8 | ||
' </Snippet1> | ||
' </Snippet1> |
Oops, something went wrong.