I'm going to try!

Discussion in 'Code Snippets and Tutorials' started by noncheatercheater, Oct 5, 2007.

  1. noncheatercheater

    Joined:
    Jun 3, 2007
    Messages:
    780
    Likes Received:
    0
    I'm going to try and write Visual Basic programs. I downloaded a book called "visual basics for dummies" (or something along the lines) and it's a pretty easy read. Just one question though:

    What program do you use?
    In the book it suggests I install VWD (Visual Web Developer) 2005 Express Edition, and I did, but is there another program I have to install? Like, Visual Studios or are these two programs separate from each other?
     
  2. ricky92

    ricky92 Administrator
    Staff Member

    Joined:
    Nov 10, 2006
    Messages:
    1,866
    Likes Received:
    67
    Download Visual Basic 2005 Express Edition from here, Visual Web Developer is made to make sites in ASP.Net, so you wouldn't be able to make EXEs of your program. And the book can help you learn "regular" visual basic, while you should just learn the Web part (and strings one too). If you need help, just ask. We're all here to help :)
     
  3. noncheatercheater

    Joined:
    Jun 3, 2007
    Messages:
    780
    Likes Received:
    0
    Thank you! I installed the visual basic 2005 and found a great tutorial on about.com and I can already make a simple program. I have a lot of ways to go before contributing to neofriends. ugh. I wish I stayed in college because I was taking C++ classes at the time! :lol:
     
  4. Xizavo

    Xizavo Level III

    Joined:
    Sep 23, 2007
    Messages:
    408
    Likes Received:
    0
    Location:
    Australia
    Goodluck
    Ive never had the nack for programing and stuff
     
  5. noncheatercheater

    Joined:
    Jun 3, 2007
    Messages:
    780
    Likes Received:
    0
    Okay, I need help. I'm trying to make a simple Hello, World! program. But instead, I want the user to put in their name and have it be desplayed where "world!" would be..

    this is my code:

    Code (C#):
    1. <div class="csharp" id="{CB}" style="font-family: monospace;"><ol><li style="padding: 0 5px; background-color: #fff; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;">&nbsp;</li><li style="padding: 0 5px; background-color: #f9f9f9; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;"><span style="color: #0600FF;">Public</span> <span style="color: #FF0000;">Class</span> HelloWorld</li><li style="padding: 0 5px; background-color: #fff; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;">&nbsp; &nbsp; Dim TextBoxContents <span style="color: #0600FF;">As</span> <span style="color: #FF0000;">String</span> = <span style="color: #808080;">"1"</span></li><li style="padding: 0 5px; background-color: #f9f9f9; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;">&nbsp; &nbsp; Dim Language <span style="color: #0600FF;">As</span> <span style="color: #FF0000;">String</span> = <span style="color: #808080;">"2"</span></li><li style="padding: 0 5px; background-color: #fff; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;">&nbsp; &nbsp; <span style="color: #0600FF;">Private</span> Sub DisplayHello_Click<span style="color: #000000;">(</span>ByVal sender <span style="color: #0600FF;">As</span> <span style="color: #000000;">System</span>.<span style="color: #FF0000;">Object</span>, ByVal e <span style="color: #0600FF;">As</span> <span style="color: #000000;">System</span>.<span style="color: #0000FF;">EventArgs</span><span style="color: #000000;">)</span> Handles DisplayHello.<span style="color: #0000FF;">Click</span></li><li style="padding: 0 5px; background-color: #f9f9f9; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;">&nbsp; &nbsp; &nbsp; &nbsp; HelloModule.<span style="color: #0000FF;">SayHello</span><span style="color: #000000;">(</span>Language<span style="color: #000000;">)</span></li><li style="padding: 0 5px; background-color: #fff; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;">&nbsp; &nbsp; End Sub</li><li style="padding: 0 5px; background-color: #f9f9f9; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;">&nbsp;</li><li style="padding: 0 5px; background-color: #fff; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;">&nbsp; &nbsp; <span style="color: #0600FF;">Private</span> Sub English_CheckedChanged<span style="color: #000000;">(</span>ByVal sender <span style="color: #0600FF;">As</span> <span style="color: #000000;">System</span>.<span style="color: #FF0000;">Object</span>, ByVal e <span style="color: #0600FF;">As</span> <span style="color: #000000;">System</span>.<span style="color: #0000FF;">EventArgs</span><span style="color: #000000;">)</span> Handles English.<span style="color: #0000FF;">CheckedChanged</span></li><li style="padding: 0 5px; background-color: #f9f9f9; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;">&nbsp; &nbsp; &nbsp; &nbsp; Language = <span style="color: #808080;">"English"</span></li><li style="padding: 0 5px; background-color: #fff; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;">&nbsp; &nbsp; End Sub</li><li style="padding: 0 5px; background-color: #f9f9f9; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;">&nbsp;</li><li style="padding: 0 5px; background-color: #fff; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;">&nbsp; &nbsp; <span style="color: #0600FF;">Private</span> Sub Español_CheckedChanged<span style="color: #000000;">(</span>ByVal sender <span style="color: #0600FF;">As</span> <span style="color: #000000;">System</span>.<span style="color: #FF0000;">Object</span>, ByVal e <span style="color: #0600FF;">As</span> <span style="color: #000000;">System</span>.<span style="color: #0000FF;">EventArgs</span><span style="color: #000000;">)</span> Handles Español.<span style="color: #0000FF;">CheckedChanged</span></li><li style="padding: 0 5px; background-color: #f9f9f9; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;">&nbsp; &nbsp; &nbsp; &nbsp; Language = <span style="color: #808080;">"Español"</span></li><li style="padding: 0 5px; background-color: #fff; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;">&nbsp; &nbsp; End Sub</li><li style="padding: 0 5px; background-color: #f9f9f9; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;">&nbsp;</li><li style="padding: 0 5px; background-color: #fff; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;">&nbsp; &nbsp; <span style="color: #0600FF;">Private</span> Sub Deutsch_CheckedChanged<span style="color: #000000;">(</span>ByVal sender <span style="color: #0600FF;">As</span> <span style="color: #000000;">System</span>.<span style="color: #FF0000;">Object</span>, ByVal e <span style="color: #0600FF;">As</span> <span style="color: #000000;">System</span>.<span style="color: #0000FF;">EventArgs</span><span style="color: #000000;">)</span> Handles Deutsch.<span style="color: #0000FF;">CheckedChanged</span></li><li style="padding: 0 5px; background-color: #f9f9f9; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;">&nbsp; &nbsp; &nbsp; &nbsp; Language = <span style="color: #808080;">"Deutsch"</span></li><li style="padding: 0 5px; background-color: #fff; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;">&nbsp; &nbsp; End Sub</li><li style="padding: 0 5px; background-color: #f9f9f9; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;">&nbsp;</li><li style="padding: 0 5px; background-color: #fff; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;">&nbsp; &nbsp; <span style="color: #0600FF;">Private</span> Sub NameText_TextChanged<span style="color: #000000;">(</span>ByVal sender <span style="color: #0600FF;">As</span> <span style="color: #000000;">System</span>.<span style="color: #FF0000;">Object</span>, ByVal e <span style="color: #0600FF;">As</span> <span style="color: #000000;">System</span>.<span style="color: #0000FF;">EventArgs</span><span style="color: #000000;">)</span> Handles NameText.<span style="color: #0000FF;">TextChanged</span></li><li style="padding: 0 5px; background-color: #f9f9f9; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;">&nbsp; &nbsp; &nbsp; &nbsp; TextBoxContents = NameText.<span style="color: #0000FF;">Text</span></li><li style="padding: 0 5px; background-color: #fff; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;">&nbsp; &nbsp; End Sub</li><li style="padding: 0 5px; background-color: #f9f9f9; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;">End <span style="color: #FF0000;">Class</span></li><li style="padding: 0 5px; background-color: #fff; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;">&nbsp;</li></ol></div>

    This is the module:

    Code (C#):
    1. <div class="csharp" id="{CB}" style="font-family: monospace;"><ol><li style="padding: 0 5px; background-color: #fff; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;">&nbsp;</li><li style="padding: 0 5px; background-color: #f9f9f9; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;">Module HelloModule</li><li style="padding: 0 5px; background-color: #fff; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;">&nbsp; &nbsp; Sub SayHello<span style="color: #000000;">(</span>ByVal HelloLanguage <span style="color: #0600FF;">As</span> <span style="color: #FF0000;">String</span><span style="color: #000000;">)</span></li><li style="padding: 0 5px; background-color: #f9f9f9; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;">&nbsp; &nbsp; &nbsp; &nbsp; Select <span style="color: #0600FF;">Case</span> HelloLanguage</li><li style="padding: 0 5px; background-color: #fff; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF;">Case</span> <span style="color: #808080;">"English"</span></li><li style="padding: 0 5px; background-color: #f9f9f9; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; HelloWorld.<span style="color: #0000FF;">HelloWorldLabel</span>.<span style="color: #0000FF;">Text</span> = <span style="color: #808080;">"Hello, "</span></li><li style="padding: 0 5px; background-color: #fff; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; HelloWorld.<span style="color: #0000FF;">DisplayHello</span>.<span style="color: #0000FF;">Text</span> = <span style="color: #808080;">"English"</span></li><li style="padding: 0 5px; background-color: #f9f9f9; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF;">Case</span> <span style="color: #808080;">"Español"</span></li><li style="padding: 0 5px; background-color: #fff; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; HelloWorld.<span style="color: #0000FF;">HelloWorldLabel</span>.<span style="color: #0000FF;">Text</span> = <span style="color: #808080;">"Hola, "</span></li><li style="padding: 0 5px; background-color: #f9f9f9; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; HelloWorld.<span style="color: #0000FF;">DisplayHello</span>.<span style="color: #0000FF;">Text</span> = <span style="color: #808080;">"Español"</span></li><li style="padding: 0 5px; background-color: #fff; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF;">Case</span> <span style="color: #808080;">"Deutsch"</span></li><li style="padding: 0 5px; background-color: #f9f9f9; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; HelloWorld.<span style="color: #0000FF;">HelloWorldLabel</span>.<span style="color: #0000FF;">Text</span> = <span style="color: #808080;">"Hallo, "</span></li><li style="padding: 0 5px; background-color: #fff; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; HelloWorld.<span style="color: #0000FF;">DisplayHello</span>.<span style="color: #0000FF;">Text</span> = <span style="color: #808080;">"Deutsch"</span></li><li style="padding: 0 5px; background-color: #f9f9f9; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF;">Case</span> <span style="color: #0600FF;">Else</span></li><li style="padding: 0 5px; background-color: #fff; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; HelloWorld.<span style="color: #0000FF;">HelloWorldLabel</span>.<span style="color: #0000FF;">Text</span> = <span style="color: #808080;">"Error/Error/Fehler"</span></li><li style="padding: 0 5px; background-color: #f9f9f9; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; HelloWorld.<span style="color: #0000FF;">DisplayHello</span>.<span style="color: #0000FF;">Text</span> = <span style="color: #808080;">"Try Again!"</span></li><li style="padding: 0 5px; background-color: #fff; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;">&nbsp; &nbsp; &nbsp; &nbsp; End Select</li><li style="padding: 0 5px; background-color: #f9f9f9; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;">&nbsp; &nbsp; End Sub</li><li style="padding: 0 5px; background-color: #fff; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;">End Module</li><li style="padding: 0 5px; background-color: #f9f9f9; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;">&nbsp;</li></ol></div>

    I know I'm supposed to make a string out of whatever's in the text box and that's what I did but I don't know how to make the two strings show up. All I get is 1) while I'm typing IN the text box, the text shows up in the label box at the same time.. and 2) it doesn't show up at all..

    Like, common sense to me would be to put (language & textboxcontents) but obviously, things don't work like that :-(

    help!
     
  6. ricky92

    ricky92 Administrator
    Staff Member

    Joined:
    Nov 10, 2006
    Messages:
    1,866
    Likes Received:
    67
    Uhm, this thing looks too complex to start with. You should just put a textbox, called "txtName"... Then use MessageBox.Show("Welcome, " & txtName.text) to display a alert popup with your name...
     
  7. noncheatercheater

    Joined:
    Jun 3, 2007
    Messages:
    780
    Likes Received:
    0
    I was using the tutorial on about.com and it started out as a simple Hello, World! program and at the end of the lesson, he said "see if you can put text in a text box and make it appear in the label". Then he progressed and added the three options for the languages. And then said "see if you can figure out how to get the language to appear on the button" and I figured that out.

    Now I'm just trying to see how I can get the text from the text box to appear in the label box along with the "hello, " language
     
  8. ricky92

    ricky92 Administrator
    Staff Member

    Joined:
    Nov 10, 2006
    Messages:
    1,866
    Likes Received:
    67
    Ok, then just use & to concatenate strings. Or you can use another way, use the SayHello Sub in the module and then add the name to the label. Example:
    Code (vb.net):
    1. <div class="vbnet" id="{CB}" style="font-family: monospace;"><ol><li style="padding: 0 5px; background-color: #fff; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;"> &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #FF8000;">Private</span> <span style="color: #0600FF;">Sub</span> DisplayHello_Click<span style="color: #000000;">(</span><span style="color: #FF8000;">ByVal</span> sender <span style="color: #FF8000;">As</span> System.<span style="color: #FF0000;">Object</span>, <span style="color: #FF8000;">ByVal</span> e <span style="color: #FF8000;">As</span> System.<span style="color: #0000FF;">EventArgs</span><span style="color: #000000;">)</span> <span style="color: #FF8000;">Handles</span> DisplayHello.<span style="color: #0000FF;">Click</span></li><li style="padding: 0 5px; background-color: #f9f9f9; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; HelloModule.<span style="color: #0000FF;">SayHello</span><span style="color: #000000;">(</span>Language<span style="color: #000000;">)</span></li><li style="padding: 0 5px; background-color: #fff; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; HelloWorldLabel.<span style="color: #0000FF;">Text</span> &= TextBoxContents</li><li style="padding: 0 5px; background-color: #f9f9f9; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF;">End</span> <span style="color: #0600FF;">Sub</span></li></ol></div>
    The "&=" part is a faster way to concatenate a string with the variable string. Example:
    Code (vb.net):
    1. <div class="vbnet" id="{CB}" style="font-family: monospace;"><ol><li style="padding: 0 5px; background-color: #fff; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;"> &nbsp; &nbsp; &nbsp; &nbsp;strMessage = <span style="color: #808080;">"Hi, "</span></li><li style="padding: 0 5px; background-color: #f9f9f9; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;">&nbsp; &nbsp; &nbsp; &nbsp; strMessage &= <span style="color: #808080;">"John"</span></li></ol></div>
    In this example we get a string containing "Hi, John". It's the fastest way to concatenate strings with the variable, cause the only alternative method would be:
    Code (vb.net):
    1. <div class="vbnet" id="{CB}" style="font-family: monospace;"><ol><li style="padding: 0 5px; background-color: #fff; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;"> &nbsp; &nbsp; &nbsp; &nbsp;strMessage = <span style="color: #808080;">"Hi, "</span></li><li style="padding: 0 5px; background-color: #f9f9f9; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;">&nbsp; &nbsp; &nbsp; &nbsp; strMessage = strMessage & <span style="color: #808080;">"John"</span></li></ol></div>
    The result would be exactly the same, but it's longer to write. But the example above could be useful for every kind of string concatenation, cause you can concatenate two different variables too!!!

    Hope this is helpful. If it's not, just post what you didn't understand here :)
     
  9. noncheatercheater

    Joined:
    Jun 3, 2007
    Messages:
    780
    Likes Received:
    0
    omg, thank you so much, it worked!

    i know the & had to be in there somewhere!!
     
  10. noncheatercheater

    Joined:
    Jun 3, 2007
    Messages:
    780
    Likes Received:
    0
    Okay, so I've been studying.. and I came up with a simple program (neopets related)

    I have a basic idea on how to loop and stuff but I have a few questions:

    What code do I need to make the program search the source code of a website?

    like a search result?

    Do you understand what I'm saying?


    actually, is there a program out there that breaks down existing VB programs? Maybe I can take a look at an aber or something and see how it works..
     
  11. the_skip

    the_skip Level IV

    Joined:
    Dec 25, 2006
    Messages:
    2,354
    Likes Received:
    1
    Location:
    Indiana
    You;ll need to use ricky's module to saerch file and mystical's wrapper to find the source. YEs you can decompile .net but it is not going to have anything like it ex of what it would turn out
    00G131G
    4GFSDF
    A bunsk of .net assembly, your best if to ask someone or look at some source code. Look at the avatr grabber I added to my post