Re: A object is passed to a function using java script - read write -

Tech-Archive recommends: Fix windows errors by optimizing your registry



Hi Frank,

Sounds like the author was a bit unclear in his/her terminology, for
whatever reason. What he/she was describing was the concept of passing
variables by value or by reference. When a variable is passed by value, a
copy of the variable is passed to the function. Therefore, if you change the
value of the passed value, it has no effect on the actual variable that was
passed. When a variable is passed by reference, a pointer to the variable
itself is passed to the function. This means that when you change the value
of the passed variable in the function, you are changing the variable
itself.

So, what the author was saying (rather poorly) is that in JavaScript
variables are passed by reference. That is, for example, if you pass a
textbox to a function, and change the value of it in the function, the value
in the actual textbox is changed by doing so.

I sincerely appreciate your willingness to study and learn the principles of
programming!

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Ambiguity has a certain quality to it.

"Frank H. Shaw" <FrankHShaw@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:70823BAA-D1D4-48F1-8E82-3B964C46C47E@xxxxxxxxxxxxxxxx
>A object is passed to a function using java script - read write - issues. I
> was reading in a book on javascript and it meatained the passing of a
> object
> to a function is passed in with read and write capability but it did not
> go
> into explaining it any more then that so could some one explain what that
> means and why one needs such capability. Also it meantain that properitys
> did
> not have read write in a function. One seems to contrdit the other please
> explain.


.



Relevant Pages

  • Re: Need Validation of Class/Picbox Assignment
    ... rather than leaving it off or using "ByRef"? ... ByRef means you are passing the reference to a variable. ... ' Add a textbox to a new form and paste in the code... ...
    (microsoft.public.vb.general.discussion)
  • Re: How Can I Do This?
    ... I have a Function that I would like to pass the form name and the textbox name to. ... Since you are passing and object and a textbox (both are reference types) and you aren't "replacing" the actual object nor are you "replacing" the actual textbox instance, these do not need to be passed by reference. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: pointer syntax
    ... > really passing a reference (which is like an old-school pointer, ... > a copy of the primitive's value and passing that. ... build them yourself with pointers. ... mean a var parameter, write a var parameter. ...
    (comp.lang.pascal.delphi.misc)
  • Re: Passing by reference
    ... It depends upon the reason one is passing the reference. ... instantiate all relationships via a constructor so there will always be ... I naturally think of 'getter' methods as 'knowledge ...
    (comp.object)
  • Re: Using ref
    ... the address of a variable that contains a reference to an object, ... the C version is passing the address of a variable that contains the   ... Inasmuch as the specification is unambiguous, there is a single truth. ... Every time he states the incorrect view, I will feel compelled to correct his incorrect statements. ...
    (microsoft.public.dotnet.languages.csharp)