Login Register






Thread Rating:
  • 0 Vote(s) - 0 Average


Need help with Codedom and making a downloader filter_list
Author
Message
Need help with Codedom and making a downloader #1
Hey, I've decided to code my own little downloader in VB.NET. I'm actually having issues with this..

VS is telling me some variables are accessible and such. The variables I use are inside of an IF statement and declared at the top of the Sub.

Here are some screenshots that layout my code and the problem. I know its only a warning, but I don't really want to take the chance. Any way you think you can help?

http://gyazo.com/31d8fb572788bc398e4d5c2...1338078744
http://gyazo.com/473796dee8506ff472b2c61...1338078798
http://gyazo.com/a3aa52e4d1550090d2e5a66...1338079357


Here is my codedom text file source that will be compiled.
http://gyazo.com/d9523b7ccae5bf1fdbaee8e...1338079616


Many thanks if anyone can help me (:

Reply

RE: Need help with Codedom and making a downloader #2
With 'installpath' variable, you can't ensure that one of the if statement blocks are going to assign it a value, so it's still not been assigned a value since it's declaration as far as the compiler is concerned. That's why it's a warning and not an error, define it, and upon declaration give it the value of String.Empty to see.

Then before you do anything with it, if it can't be empty, then check with String.IsNullOrEmpty() and do something accordingly in that event.

Try some Case statements as well, you're cluttering your code with all these if statements and many ElseIf's. Smile
ArkPhaze
"Object oriented way to get rich? Inheritance"
Getting Started: C/C++ | Common Mistakes
[ Assembly / C++ / .NET / Haskell / J Programmer ]

Reply







Users browsing this thread: 1 Guest(s)