Cool Visual Basic
 
Main
Frequently Asked Questions
VB Helpdesk
Message Boards
Library
Downloads
View Guestbook
Add to Guestbook
Product Reviews
Bookstore
Links
Newsgroups
Vendors
Affiliates
Cooltech.org

Cool VB FAQ


Text Format

The best Visual Basic FAQ(Frequently Asked Quesitions) file on the internet. Do you have a problem that's got you stumped? Do you have the answer to one? We've done our best to make this the best resources for the questions and the answers. Post a question, or a answer to one, by sending email to VBQA@beadsandbaubles.com.

      Root

            Coding

  • I've heard that using END is dangerous; what's the best way to end my program?

    Compatibility:VB3  VB4  VB5

    To end your program, use this code:

    	dim ret as object
    
    	for each ret in forms
    		unload ret
    		set ret = nothing
    	next
    

     

     

  • What does it mean to pass by reference?

    Compatibility:VB3  VB4  VB5

    When you pass by reference, you get the actual variable. (You pass by reference by default.)

    In contrast, when passing by value, you get a copy of the variable.

    The net effect is passing by value prevents you from changing the variable

     

     

  • What is Option Explicit and why should I use it?

    Compatibility:VB3  VB4  VB5

    When you use Option Explicit, you have to declare all of your variables.

    For instance:

    sub mySub()
           dim i as integer
           i = 3                 'Works with either
           x = 3                'Works only when option explicit is disabled.
           ...
    end sub
    

     

     

  • How can I break up long lines of VB code?

    Compatibility:VB3  VB4  VB5

    Use a space followed by a underscore, like this:

    	debug.print "Hi! "; _
    		"World!"
    

     

     

    LinkExchange
    LinkExchange Member Free Home Pages at GeoCities


    Copyright 2000, David J Berube<Form1@aol.com>. All Rights Reserved.