Re: How to return reference of value from function?
From: Tony Proctor (tony_proctor_at_aimtechnology_NOSPAM_.com)
Date: 05/21/04
- Next message: Alex Ivanov: "Re: Implements Interface difference in VB IDE and Compiled version, is this a BUG!???"
- Previous message: John: "step into a C++ dll from VB6"
- In reply to: Peter Young: "Re: How to return reference of value from function?"
- Messages sorted by: [ date ] [ thread ]
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
>
>
- Next message: Alex Ivanov: "Re: Implements Interface difference in VB IDE and Compiled version, is this a BUG!???"
- Previous message: John: "step into a C++ dll from VB6"
- In reply to: Peter Young: "Re: How to return reference of value from function?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|