Exam coming up, I have questions I need help answering.

Posted on 2008-11-11
Last Modified: 2013-11-26
I have an upcoming exam and I don't have access to my professor and I have questions that the book is not clarifying for me.  The book that the class is using is Murach's Visual Basic 2008.

iI will list the questions will by numbers.  I understand that there are alot of questions here but I really need a good grade on this exam and these are the areas that I am still unsure of.  Some of the questions, I have tried to answer and I posted a comment in (), it my guess is correct could you annotate so.  If not could you help me get on base.

I am taking the exam tomorrow at 11.  I have been buried in this book for a couple of days now and I need help.  I am using this site as a last resort.  I figured individuals on here are much more proficient than myself so I mine as well ask the experts.  

I want to thank anyone in advance that is willing to answer any of these questions for me.  God Bless and Happy Veterans Day.  I myself am an "Iraq Veteran" in 2003.3. When and how to pass arguments by reference and by value?
       - The book says this.  I dont understand what it is saying at all:

Arguments are passed by value.  Because of that, the procedure can change the value of the parameter without affecting the value of he variable in the calling procedure.

In some cases, though, you will want to be able to change the value of the variable in the calling procedure from the called procedure.  To do that, you can pass the argument by reference.
When you call the procedure, a reference to that variable is passed to the procedure.  As a result, if that called procedure changes the value of the parameter, it also changes the value of the variable in the calling procure.  

If you pas a reference type by reference, you still cant change its value (the reference), but you can change the values of members of the object it refers to.  In contras if you pass a reference type by value, you can change both its value and the values of its members.

Can you explain this in laymen terms?
Question by:nosurf2day
    LVL 53

    Expert Comment

    ByVal and ByRef: Passing Arguments in Visual Basic

    LVL 53

    Expert Comment

    Byval is a way of passing parameters in by Value. This means that if you have 2 variables, a and b, and you pass them into a function with a=1 and b=2:

    private sub function1(byval a as integer, byval b as integer)
    end sub

    Once you get out of this function, a will still be = 1, and b will still be = 2. If you were to use ByRef instead of byval... once you get out of the function a would b = 50 and b would be = 60.

    Hope this helps.

    By the way, passing parameters by reference is much more costly and time consuming than passing them by value.
    LVL 53

    Accepted Solution


    Author Closing Comment

    Once again, you rock!  Thanks for all the help, I have 30 min before I take my exam and I am feeling much better.

    Featured Post

    Top 6 Sources for Identifying Threat Actor TTPs

    Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

    Join & Write a Comment

    Suggested Solutions

    In my previous two articles we discussed Binary Serialization ( and XML Serialization ( In this article we will try to know more about SOAP (Simple Object Acces…
    For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK ( for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
    Hi everyone! This is Experts Exchange customer support.  This quick video will show you how to change your primary email address.  If you have any questions, then please Write a Comment below!
    In this sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a c…

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now