VB.net
IterationIteration
Templates in this group are used for iterating over various containers. Since these templates are parameterized, you will need to fill in some parameters (variables) after the template is expanded. These input fields normally include:
- Loop index variable
- Number of iterations
- Container instance
To help you complete the necessary input fields, ReSharper suggests a list of choices. They include names of variables, instances of arrays, lists available in scope etc.
| Template name | Description |
|---|---|
|
for
Go to top |
Purpose
For $VAR$ As Integer = 0 To $MAX$
$END$
Next
Before expansion
Parameters
|
|
foreach
Go to top |
Purpose
For Each $VAR$ As $TYPE$ In $COL$
$END$
Next
Before expansion
Parameters
|
|
itar
Go to top |
Purpose
For $VAR$ As Integer = 0 To $ARRAY$.Length - 1
Dim $ELEMENT$ As $TYPE$ = $ARRAY$($VAR$)
$END$
Next
Before expansion
Parameters
|
|
itdg
Go to top |
Purpose
For Each $ITER$ As $ITERTYPE$ In $DIC$
Dim $KEY$ As $KEYTYPE$ = $ITER$.Key
Dim $VALUE$ As $VALUETYPE$ = $ITER$.Value
$END$
Next
Before expansion
Parameters
|
|
itli
Go to top |
Purpose
For $INDEX$ As Integer = 0 To $LIST$.Count - 1
Dim $ELEM$ As $TYPE$ = $LIST$($INDEX$)
$END$
Next
Before expansion
Parameters
|
|
ritar
Go to top |
Purpose
For $VAR$ As Integer = $ARR$.Length - 1 To 0 Step -1
Dim $ELEM$ As $TYPE$ = $ARR$($VAR$)
$END$
Next
Before expansion
Parameters
|
