Re: "ref object a" <> "ByRef a As Object" ???

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Jon Skeet [C# MVP] (skeet_at_pobox.com)
Date: 04/08/04


Date: Thu, 8 Apr 2004 12:04:57 +0100

Cor Ligthert <notfirstname@planet.nl> wrote:
> Because about some things I readed from Jay B Harlow I am not sure of your
> message.

Which things, out of interest? Which thread?
 
> However I cannot deny it now. So maybe, ( because it does not intrest me
> that much) I will investigate it deeper and come back on this subject.
>
> However it was intresting that you do not agree with it, makes investigating
> maybe something I will do.

I'll look at it myself - if you could let me know what Jay's said.

> > Why not? It makes perfect sense in some situations.
>
> I have done in past a lot of references of pointers, however until now I see
> in VB.net no pratical use of it.

Here's an example I've used before:

public void SplitName (string wholeName, out string firstName,
                                         out string lastName)

("out" and "ref" parameters are very similar, I hope you'll agree)

So for instance:

string first;
string last;

SplitName ("Jon Skeet", out first, out last)

would end up with first="Jon" and last="Skeet".

I'm sure you can think of similar situations.

Personally I don't use out/ref parameters very often anyway, but when I
do they're just as likely to be reference types as value types.

-- 
Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too


Relevant Pages

  • RE: Passing reference type as method parameter
    ... Hi Maxim, ... reference type object but it has value type semantics, meaning a string is ... Classes are usually reference types, so in the example below the Person ... public static void ChangePersonName ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Passing reference type as method parameter
    ... String is immutable sequence of characters ... > Classes are usually reference types, so in the example below the Person ... > public static void ChangePersonName ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Did Borland doing well in Q4? Listen to the Earning CC
    ... Ironically Delphi already essentially has string objects (they are ... We just don't have a string "class". ... benefits of reference types with the simplicity and clarity of value ... With Tiburon I suspect ...
    (borland.public.delphi.non-technical)
  • Re: Function Warning - Null Reference
    ... not reference types like Strings. ... As you all are than so concerned about the correct name for the string, ... DateTime structure which Stephany calls in the same sentence a value ... I find it an insult to tell that a so long regular as Stephany does not ...
    (microsoft.public.dotnet.languages.vb)