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++:
----
int a = 10;
int& somefunc()
{
return a;
}
void main()
{
int& c = somefunc();
c = 20; // a = 20
printf("a = %d\n", a);
int& d = somefunc();
d = 30; // a = 20
printf("a = %d\n", a);
}
----
So, how can I do same thing in VB?
I'll be grateful for any help...
--
Best Regards,
Levan Jgharkava
PS: There are 10 types of people in this world, those that understand
binary, and those that don't ;)
Cette action est irreversible, confirmez la suppression du commentaire ?
Signaler le commentaire
Veuillez sélectionner un problème
Nudité
Violence
Harcèlement
Fraude
Vente illégale
Discours haineux
Terrorisme
Autre
Armin Zingler
"Levan Jgarkava" schrieb
How can I return reference of value from function, so, that I could
Don't include all those newsgroups in your question! This (microsoft.public.de.vb) is a German speaking group. Also don't include all the other groups because they are Chinese, French and so on.
-- Armin
How to quote and why: http://www.plig.net/nnq/nquote.html http://www.netmeister.org/news/learn2quote.html
"Levan Jgarkava" <levanikoNoSpam@mailru.com> schrieb
How can I return reference of value from function, so, that I could
Don't include all those newsgroups in your question! This
(microsoft.public.de.vb) is a German speaking group. Also don't include all
the other groups because they are Chinese, French and so on.
--
Armin
How to quote and why:
http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html
How can I return reference of value from function, so, that I could
Don't include all those newsgroups in your question! This (microsoft.public.de.vb) is a German speaking group. Also don't include all the other groups because they are Chinese, French and so on.
-- Armin
How to quote and why: http://www.plig.net/nnq/nquote.html http://www.netmeister.org/news/learn2quote.html
Knuth Konrad
Hi there
Levan Jgarkava wrote:
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?
Simple enough:
Function SomeFunc(ByVal lInput As Long) As Long
SomeFunc = lInput
End Function
Knuth
Hi there
Levan Jgarkava wrote:
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?
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?
Simple enough:
Function SomeFunc(ByVal lInput As Long) As Long
SomeFunc = lInput
End Function
Knuth
Zoury
> Don't include all those newsgroups in your question! This (microsoft.public.de.vb) is a German speaking group. Also don't include
all
the other groups because they are Chinese, French and so on.
hehe! I'd even say don't include *any* of these groups in your question since none of them is intended for english-speaking people. :O)