Matt Harvey <rifleman@gmail.com> wrote:[color=blue]
> The solution to this is most undoubtedly obvious, but I can't seem to
> figure it out...your help is appreciated[/color]
<snip>
[color=blue]
> When compiling, I get use of unassigned local variable on the catch
> statement for array1.
>
> As you can see, however, my array gets assigned inside of the try block.[/color]
Assuming it gets that far. An exception could be thrown asynchronously
before that assignment happens.
[color=blue]
> If I try to initialize array1 to null when I declare it, assigning
> values to it errors out.[/color]
You should initialize it to null before the try, then assign it as you
are doing within the try - or assign it to new string[10] before the
try to start with.
What *exactly* do you mean by "errors out"? Where does the exception
occur and what exception is it?
--
Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet Blog:
http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too