Re: Dim inside If..? by Peter
Peter
Sat Sep 24 07:53:14 CDT 2005
"Carlos Albert" <nadie@ningunlugar> wrote in message
news:eBf%23ZHIwFHA.3720@TK2MSFTNGP14.phx.gbl...
>I have a function with If... Else... End If...
>
> And inside the If I wanted to define some datasets and stuff... but the
> visual says not.
>
> Is there any way to do it?
>
>
Per haps if you were to show us some of the code where your Dim attempt
fails, of provide further details...
As stated by others, using Dim inside an if or else block should work OK.
If isLocalMethod = "True" Then 'See commentary above.
Dim a As Integer
Dim b As Integer
a = 3
b = 3
Dim c As Integer = a + b
All compiles and executes correctly.
--
Peter [MVP Visual Developer]
Jack of all trades, master of none.