Message 1 of 7
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
I have a question about the variable definition. When using "Dim" in front of a variable name I am not able to use that variable in different blocks (Select Case example).
When I do not use "Dim" in front of the name I can use the same variable everywhere like in the following example:
Dim oOptions As New List (Of String) oOptions.Add("1.Choice number 1") oOptions.Add("2.Choice number 2")
Dim oChosenOption As String = InputListBox("Choose option", oOptions, "", "Railing type", "List of Options")
Select Case oChosenOption '] Case "1.Choice number 1" oNewPart = Components.Add(oPartPrefix1 & i, oPartFile1, part_pos, grounded := True) Case "2.1.Choice number 2"
oNewPart = Components.Add(oPartPrefix2 & j, oPartFile1, part_pos, grounded := True)
End Select
If I used "Dim oNewPart" in place of "oPart" I would get an error when saving.
Can somebody please explain why is that?
Tom
Solved! Go to Solution.