Entries:
Comments:
Posts:

Loading User Information from Channel 9

Something went wrong getting user information from Channel 9

Latest Achievement:

Loading User Information from MSDN

Something went wrong getting user information from MSDN

Visual Studio Achievements

Latest Achievement:

Loading Visual Studio Achievements

Something went wrong getting the Visual Studio Achievements

Creating Your First Visual Basic Program - 02

Embed code for this video

Copy the code above to embed our video on your website/blog.

Close

Video format

Option selected may change based on video formats available and browser capability.

Close

Download

Right click “Save as…”

In this lesson you'll create a simple application twice -- the first time using Windows Notepad and the Visual Basic Command Line Compiler, then then second time using Visual Studio or Visual Basic Express Edition. The point of this video is to demonstrate how much easier your work becomes by utilizing an Integrated Development Environment (IDE) than simply attempting to work in a loose collection of windows and tools. The video concludes by explaining common solutions to the many different problems you might encounter as you first beginning writing and compiling code.

 Download the source code for Creating Your First Visual Basic Program.

 IMPORTANT UPDATE:  Before you watch this lesson, please make sure you have watched this video to learn about changes to Visual Studio since this series was originally recorded.

Tag:

Follow the Discussion

  • Hey that was a great Video great job Bob.  I actually have been programming for a while so this was not new, but I did learn how to compile code from command line which was great.  Tnx for a great lesson!

  • C10C10

    Hey Bob these are really great videos.
    You know, it's quite embarrasing to have problems in the first lesson, but my Command prompt is showing me an error. It's "error BC30451", aparently 'Console' is not declared.
    I've written every word exactly the same as you've written yours, could you help me?. What do I have to do to make it work?

  • @C10:Two things ... first, are you getting stuck with the command line version or the IDE version of the project / video?  Second, would you mind posting the code directly in a reply to this message?  Thank you!

    PS ... never be embarrassed.  While I'm willing to bet the solution is something really small, you'll have thousands of these little humbling moments as you continue programming.  Happens to me every day (hopefully not the same thing twice, but even THAT has happened!)  Smiley

  • devoriadevoria

    for me it workd as well as i saw in your video
    just one minute i love your teaching ability, you are a real maser, when my college teach us coding i sleep, but with your video i become more carious because i just not love the course but also you the teacher, thanks BOb

  • Paul BreenPaul Breen

    Bob:
    Visual Studio and express make things a little easier by using the console window links provided. They are called "Visual Studio Command Prompt" and are listed in the visual studio tools menu. I am pretty sure they are in the expresss version too. What you can do with them is just type "vbc test.vb" and you don't have to fiddle with long paths etc or set you environment variable path.
    I don't want to push command line compiling but it is a way to learn some things and if you have a cheap computer like mine, it is way faster. Could you put some coverage of the mgdb command line debugger? This is set up by the visual studio link tool I mentioned above. So you can just mgdb test.vb (if you use the debug command flags). It is very simple really to get started.
    thanks for the videos

  • @Paul Breen: Great tip!  I just booted up Visual Basic 2010 Express Edition and unfortunately it does not contain the Visual Studio Command Prompt, so unfortunately that wouldn't work for the requirements of this video series.  Furthermore, I'm NOT a command line guy so the mgdb tip is new to me.  Thanks for the great ideas!

  • KeefKeef

    I haven't coded since I was 15, over 22 years ago coding 68k assembler and have basically forgotten everything and anything.

    VB seems to be a nice introduction to coding again before I take the leap into Java. Just the style of your tutorials, and the way you explain things, not just what needs to be done but WHY they need to be done, tells me this is going to go a lot smoother than I thought.

    Looking forward to the rest of the lessons.

  • Lil AoLil Ao

    Bob, I am unsure of how to move forward. I have "c:\HelloWorld\helloworld.vb(3) : error BC30451: 'Console' is not declared. It may be inaccessible due to its protection level.

    Console.WriteLine("Hello World!")"

    Then the same for console.ReadLine()

    Now what?

  • @Lil Ao: Two things ... first, don't forget what I say in the video -- that whole command line example was to impress on you that, without a tool like Visual Studio (or the Express Editions) writing programs would be really tough ... exactly for the reasons you've now seen!!!  SO, as to "now what?"  You COULD just ignore this and move on with the rest of the series.  But if you really want to figure it out ...

    Second, by virtue of the fact that it says it cannot see the Console object, I'm guessing there's something fundamentally wrong with your code.  Did you try to download the code (see below the video), copy that file into your directory, then attempt to compile that?  If that DOES work, then compare what's in my version of helloworld.vb versus your version of helloworld.vb.

    If it STILL doesn't work, then I would need to see what commands you're typing into the DOS Prompt / Command window to invoke the compiler.

    I'll try to help you get this straightened out! Best wishes! -bt

  • AlvAlv

    Wow, the video's keep getting better and better.

    I remember seeing the first vids from Bob Tabor and thought they were very informative and helpful to the beginner but they've gone up to a new level.

    Highly impressive, highly educational, well presented and very professional. 4 and a half stars.... leaving some room for your next series of videos :)

  • KenKen

    Great video!

  • TaxusTaxus

    Bob, one tip I spotted which you did on the video but did not emphasise was the typing of opening and closing parantheses and opening and closing quotes and Sub and End Sub Clauses at the same time. This avoids one of the common errors that most of us are guilty of and to which you alluded - "forgetting to close". Typing the closing part at the same time as the opening part is very easy to do and can avoid a lot of head scratching later on!

    (not sure whether it was a "just making sure you are paying attention" moment but you have a typo in the Recap bullet point 2 re preciseness!)

  • JudyJudy

    I have a few questions. I started to watch you video. I did the HelloWorld and it worked, but I'm wanting to creat macros using VB in PowerPoint and Excel...Should I keep going even if I'm not using Visual Express???

  • @Taxus:  Thank you ... and oh, the irony of "preciseness".  Sad

    @Judy: Honestly, this probably will *help* but it will not be directly applicable.  You are interested in VBA, or rather, Visual Basic for Applications, which has a similar syntax, but a good tutorial on VBA would also teach you about the Office API, which we will not cover at all in this series.  Also, things like data types, etc. are different (at least, I think).  Sorry, I know almost nothing about VBA.  Hope that helps!

  • Will KWill K

    Thank you Bob your video's are very clear & concise. I'm new programming and your tutorial's on learn Visual Studio.NET have helped me grasp the concept quite easily.
    I will buy your life membership well worth it
    Thanks Bob!!

  • @Will K:  Outstanding.  Glad you enjoyed these.  More coming ...

  • Hello Bob!
    I have high hopes for these Tut's!
    I'm learning programming at school but computers were always "the center of my solar system" , "my universe" , my life.
    Pascal isn't challenging enough for me! I know that I will have VB next year, so I started learning QBasic on my own, The internet and books are the source of knowledge!
    QBasic had its problems but I read that it would be the best way to "port" to VB.
    With the Pascal background I have the "Logic" which is the basis of all programming, I feel confident that taking this step will take me further into the vast "universe" of programming.

    I leave a small message to all, if you really love programming and feel the passion, search and fight for it! spend all the time you can (of course) researching , viewing and reading tutorials , experiment ! 

    I'm only 19 years old and honestly I don't like math! But when I'm programming I don't care if its math or not, sometimes is boring but the end result always makes up to the time that I spent looking at lines of code and correcting bugs!

    Thanks Bob! Thanks Microsoft! Thanks Man Kind for this gift! The tools to make our dreams come true!  Smiley

  • harrywwcharrywwc

    G'day Bob,

    I'm a teacher in a technical college in NSW, Australia, and always on the lookout for "Beginners Resources" for my students. This looks like Gold.

    One minor nit - in DOS, the "\" is technically "back-slash" (or "slosh"), not a "slash" ("/" - or "forward-slash").

    Additionally, and perhaps you don't want people to become comfortable on the CLI ;) the CMD.exe on NT6.x has a <tab> command completion option - so typing all of the, say, 'v4.0.30319' directory name - could have been read out as "type cd v4 press <tab> to complete the line, and press <enter>".

    But yeah, expect a number of hits from Australia over the next week or so as my students panic about their assignment due real-soon :)

    Kind regards,

    Harry

  • @harrywwc: Great feedback!  I know some of these, but in the heat of the moment when you've hit the record button, you revert to whatever comes to mind in that moment.  Points well made, and best wishes to you and your students ... even the ones who are finishing up their studies at the 11th hour.  Big Smile

  • AbidAbid

    Hey Bob, is it possible to have two inerfaces in one program (Command Line & GUI). Can I launch a console window from GUI, sort of like forms.

  • AzamAzam

    Hey! I was getting so mad with cmd and using the vbc to make the exe, It took me an hour to realize I was wasting my time. I gave up, made a bat file, and used a bat to exe compiler. Thanks for the great videos.

  • knailerknailer

    A teacher you are and easier isn't always the best. I really would like to at least become accustomed to using the notepad and command line first. Can you point me in that learning direction?

  • YairYair

    Hello, Bob. I'm having a problem with my "HelloWorld" Application. I'm pretty sure I followed all the instructions carefully, but when I try to open the application, it flashes on screen for a brief moment then disappears. Any idea why this is?

  • @knailer: When .NET first came out, people really were pushing that and books would feature that.  I wrote a book at that time, and the reviewer smashed me for not taking a Notepad+Compiler perspective.  But I think everyone has come around to accepting that the IDE is your friend, and the better the IDE, the friendlier the experience.  I don't know of any resources but I'm sure they're out there.  But let me really encourage you to learn Visual Studio's IDE inside and out.

    @Yair: Did you forget a Console.ReadLine(); at the very end of the program?  Smiley

  • newbie here.  I cannot get any audio with any of these tutorials.  Any idea what I need to do?

    Thanks

    Stacy Whetzell

    slwbid

    slwhetzell@tva.gov

  • Clint RutkasClint I'm a "developer"

    @slwbid: emailed you

  • RobRob

    I cannot get audio with this or any of the videos either.
    Can someone help?

  • chrischris

    i shorten up things but i get this~ vbc : Command line error BC2012 : can't open 'c\hello\hello.exe' for writing

  • @chrisc\hello\hello.exe ... you missed the semi-colon ... c:\hello\hello.exe ... assuming you do have the other names spelled correctly, etc.  Hope that helps?

  • chrischris

    thank you sir, i do feel silly, i had copied note pad deleted it pasted a new 1 and for some reason ever thing went fine

  • Usman Abubakar UmarUsman Abubakar Umar

    Vb is so amazing bcus I remember when 1st I use it to design a calender that display time,date,year. If u have any sort of example that will help me please make all procedure steps draw the GUI,assign properties and the code. Thanks 4rm a student of computer engr kano state poly.

  • ahsan ullahahsan ullah

    hi bob.i want to become expert in vb.how can i do this?

  • @ahsan ullah: Spend every extra minute you have learning, practicing and reading.  I'm no expert, but that's what I do.  Good luck!

  • Femi AderantiFemi Aderanti

    hello Bob,
    I tried this code in visual basic 6.0 and discovered it's not working. There are several errors and, the program didn't run. I also discovered there is no keyword like "Module" in VB6. Is this disparity a result of the difference in the VB application version?. I can see you are using VB express 2010.
    Thank you.

  • Hello Bob,
    I tried this code in visual basic 6.0 and discovered it's not working. There are several errors and, the program didn't run. I also discovered there is no keyword like "Module" in VB6. Is this disparity a result of the difference in the VB application version?. I can see you are using VB express 2010.
    Thank you.

  • @Femi Aderanti: @closecalls: This will not work with VB6.  What I say next is my personal advice -- not Microsoft's official position:   VB6 is dead.  VB6 was released in October 1998, over 14 years ago.  There have been 6 versions since VB6, all .NET.  VB6 is never coming back.  You MUST switch for your career's sake.  Visual Basic 2012 is free! Please use that link, download, install, then watch this series.  Hope that helps!

  • KioskayKioskay

    Hello Bob,
    You are the best teacher I've ever seen by d way i am a student of class 9 n we have d chapter visual basic in our book but i cant understand a thing as our teacher is crap.
    So thanx a lot fr these videos !
    my question is that i am watch these videos on mac !
    n is there any way i can use visual basic on mac without paying anything !
    Please Help ! :D

  • @Kioskay: Hi and thanks for the nice words! re: mac ... I've never used this product, but in theory this should work:

    https://www.virtualbox.org/

    That will allow you to create a virtual machine containing Windows (like VMWare or Parallels).  Then you can install Visual Basic 2012 Express and run it.  The other option is to switch to C# and use Mono:

    http://www.mono-project.com/Main_Page

    The third option is to use Bootcamp on the Mac to create a partition and load up Windows, VB, etc.

    Without Mono, there's no way I'm aware of to run .NET applications on a Mac ... you could create Web Applications that can run in *any* browser.  That's what I would recommend to most companies.

  • Tayyab MalikTayyab Malik

    Am very new to the visual basic programing . i successfully completed my second video .whenever i run the program it gives me number of errors still it displays Hello Word in console window

  • @Tayyab Malik: What do the errors say?

  • Hello bob,

    Thanks for your advise. Your videos are great. By the time I'm done with vb express, i have the intention of moving to C#. Keep up the good work.

  • @BobTabor: Thanks for your advise. Your videos are great. By the time I'm done with vb express, i have the intention of moving to C#. Keep up the good work.

  • Pavan SoorPavan Soor

    Thanks for all your efforts. I have just downloaded Visual Studio Express 2012, and there is no such 'Console Application' available when I click New Project. How can I proceed? Thanks

  • @Pavan Soor: Check this out:

    Important Update Video

     ... we just uploaded it yesterday ... sorry for the confusion -- things change!

  • CraigCraig

    Nice video Bob. Found the second point on the recap slightly ironic - "Writing Visual Basic srequires preciseness."

  • @Craig: Irony?  Or Genius?   Tongue Out

  • kujtimkujtim

    hi.
    I'am Kujtim Shahini, am interested in a Visual Basic program have the opportunity to send me a video link to learn to work with Visual Basic
    Thnx

  • @kujtim: Hi, not sure what you're asking for.  The videos on Channel 9 are all here and available for you to watch already.

  • cyphi1cyphi1

    Initially I forgot the ConsoleRead line while typing the code in the .vb file. After using the command prompt compiler I got a console window with Hello World flashing which only briefly flashed on screen. I had to edit, save and then recompile the file in order for the changes to take place and the window to stay open. I caught my mistake pretty quick, but if your having this problem hope this helps.

  • PinkiPinki

    Hey Bob, you are a God sent, thank you very much

Remove this comment

Remove this thread

close

Comment on the Post

Already have a Channel 9 account? Please sign in