Re: How to return reference of value from function?

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

From: Tony Proctor (tony_proctor_at_aimtechnology_NOSPAM_.com)
Date: 05/21/04


Date: Fri, 21 May 2004 16:45:48 +0100

well spotted Peter.

I must admit to not asking this same question because it would take longer
than answering it directly

            Tony Proctor

"Peter Young" <youngpa@comcast.no.net.spam.please> wrote in message
news:e8F33e0PEHA.3660@TK2MSFTNGP11.phx.gbl...
> "Levan Jgarkava" <levanikoNoSpam@mailru.com> wrote in message
news:uug%23%23oyPEHA.832@TK2MSFTNGP09.phx.gbl...
> > Hi!
> >
> > How can I return reference of value from function, so, that I could
modify
> > it? One method I know is to use a sub with ByRef value as last
parameter,
> > but is there better solution? Can I use ByRef return values?
> > Here's example in C++:
>
> <snip>
>
> > d = 30; // a = 20
>
> Actually, a = 30 in that case.
>
> Why would you ever want to do this? IMO, this is an excellent example of
how easily you can create unreadable, buggy and
> difficult-to-maintain code in C. Variable 'a' is in scope the entire time.
Just use that variable.
>
> Perhaps if you had a real-world example of where this would be useful, we
could suggest a way to accomplish the task in
> VB.
>
> And try hitting appropriate groups next time.
>
> -Pete
>
>



Relevant Pages

  • Re: How to return reference of value from function?
    ... well spotted Peter. ... I must admit to not asking this same question because it would take longer ... Can I use ByRef return values? ... how easily you can create unreadable, buggy and ...
    (microsoft.public.vb.enterprise)
  • Re: How to return reference of value from function?
    ... well spotted Peter. ... I must admit to not asking this same question because it would take longer ... Can I use ByRef return values? ... how easily you can create unreadable, buggy and ...
    (microsoft.public.vb.general.discussion)
  • Re: How to return reference of value from function?
    ... well spotted Peter. ... I must admit to not asking this same question because it would take longer ... Can I use ByRef return values? ... how easily you can create unreadable, buggy and ...
    (microsoft.public.vb.bugs)
  • Re: How to return reference of value from function?
    ... well spotted Peter. ... I must admit to not asking this same question because it would take longer ... Can I use ByRef return values? ... how easily you can create unreadable, buggy and ...
    (microsoft.public.vb.directx)