Hello,
I have this:
Select Case Session("culture4web")
Case "pt-PT"
Dim topMenuItems() As String = {"Home", "Conteúdos", "Xtras", " ", "Web", "Company"}
Case "en-GB"
Dim topMenuItems() As String = {"Home", "Conteúdos", "Xtras", " ", "Web", "Company"}
End Select
Call_Function (topMenuItems)
I am having problems because the variable disapears outside of Case Statement.
How can I solve this?
Thanks,
Miguel
Always try and define your variables outside conditional statements...
Dim topMenuItems() As String
Select Case Session("culture4web")
Case "pt-PT"
topMenuItems()= {"Home", "Conteúdos", "Xtras", " ", "Web", "Company"}
Case "en-GB"
topMenuItems() = {"Home", "Conteúdos", "Xtras", " ", "Web", "Company"}
End Select
.NET introduced an extended scoping model, block-level variables are now block-local.
Declare your dependant variables outside theSelect...End Select block:
Dim topMenuItem() As String
Select Case Session("culture4web")
Case "pt-PT"
topMenuItems = {"Home", "Conteúdos", "Xtras", " ", "Web", "Company"}
End Select
Call_Function(topMenuItems)
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment