A word to explain ByRef and ByVal

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Frinavale
    Recognized Expert Expert
    • Oct 2006
    • 9749

    A word to explain ByRef and ByVal

    In VB.NET you can pass parameters by reference (ByRef) or by value (byVal).
    Is there a word that can be used to refer to this?

    -Frinny
  • joedeene
    Contributor
    • Jul 2008
    • 579

    #2
    Originally posted by Frinavale
    In VB.NET you can pass parameters by reference (ByRef) or by value (byVal).
    Is there a word that can be used to refer to this?

    -Frinny
    ..could u clarify your question a bit...i dont quite understand, do you mean like how u can reference a class or most objects to something less you have to type?

    joedeene

    Comment

    • Frinavale
      Recognized Expert Expert
      • Oct 2006
      • 9749

      #3
      Originally posted by joedeene
      ..could u clarify your question a bit...i dont quite understand, do you mean like how u can reference a class or most objects to something less you have to type?

      joedeene
      I am looking for a word to explain what ByRef and ByVal are.

      For example the word "scope" or "modifiers" refers to keywords like "Public", "Private", "Protected" etc.

      Is there a word like the this that can be used to refer to ByRef and ByVal?


      -Frinny

      Comment

      • Plater
        Recognized Expert Expert
        • Apr 2007
        • 7872

        #4
        MSDN calls them keywords. I would call them "argument keywords" maybe?

        Comment

        • Frinavale
          Recognized Expert Expert
          • Oct 2006
          • 9749

          #5
          Originally posted by Plater
          MSDN calls them keywords. I would call them "argument keywords" maybe?
          Hmm I guess there is no word.

          I just used several sentences to explain what I was trying to say instead of trying to explain everything in a one line comment....alth ough "argument keywords" best suits them.

          Thanks though

          -Frinny

          Comment

          • balabaster
            Recognized Expert Contributor
            • Mar 2007
            • 798

            #6
            Originally posted by Frinavale
            Hmm I guess there is no word.

            I just used several sentences to explain what I was trying to say instead of trying to explain everything in a one line comment....alth ough "argument keywords" best suits them.

            Thanks though

            -Frinny
            They're actually called "Argument Modifiers"

            Comment

            • Frinavale
              Recognized Expert Expert
              • Oct 2006
              • 9749

              #7
              Originally posted by balabaster
              They're actually called "Argument Modifiers"
              Thanks!

              It seems that googling Argument Modifiers doesn't really help in understanding what I'm trying to explain. It's too abstract of a concept....

              I've decided that if my audience doesn't know what ByRef is, then they can search the web themselves to understand what I'm trying to say.

              It is nice to know that ByVal and ByRef are Argument Modifiers though!

              Thanks again :)

              -Frinny

              Comment

              • balabaster
                Recognized Expert Contributor
                • Mar 2007
                • 798

                #8
                Originally posted by Frinavale
                Thanks!

                It seems that googling Argument Modifiers doesn't really help in understanding what I'm trying to explain. It's too abstract of a concept....

                I've decided that if my audience doesn't know what ByRef is, then they can search the web themselves to understand what I'm trying to say.

                It is nice to know that ByVal and ByRef are Argument Modifiers though!

                Thanks again :)

                -Frinny
                No worries... they are a pretty abstract concept... especially if the reader doesn't understand pointers. It would be akin to trying to explain AddressOf.

                I'm not sure what the easiest way to explain this concept would be...

                Maybe:

                ByVal tells the method that the value is being passed as a value, ByRef tells the method that it is accepting the placeholder for that value and that if the value is changed in that placeholder then the changed value would also be reflected in the calling code?

                For someone that doesn't understand it, it's a hard concept to grasp... mostly I think because it's such a hard concept to explain. Once you get it, it's simple, but it's still hard to explain to someone else...

                Comment

                • Plater
                  Recognized Expert Expert
                  • Apr 2007
                  • 7872

                  #9
                  I have used the example of giving someone a box/bucket (ref) versus what is INSIDE the box(value)

                  Comment

                  • Frinavale
                    Recognized Expert Expert
                    • Oct 2006
                    • 9749

                    #10
                    What I needed to explain was that I was declaring empty string variables because the method I am calling in the example expects parameters using ByRef.

                    I didn't really want to get into to many details because I am hoping that the end user (a developer) understands ByVal and ByRef...I'm hoping that if they don't understand my comment that they'll look it up.......instea d of calling me.....


                    Hmm maybe I do need to explain this a bit better.

                    Comment

                    Working...