Connecting Tech Pros Worldwide Forums | Help | Site Map

CallbyName in C#

MFRASER
Guest
 
Posts: n/a
#1: Nov 15 '05
Is there any CallbyName function inside of C#.

I need to shift my items in a collection

Psuedo code
aItem has hours 1-24 and I need to be able to shift the hours.
foreach(MapItem aItem in aCol.Items)

{

}





Jan Tielens
Guest
 
Posts: n/a
#2: Nov 15 '05

re: CallbyName in C#


You can do the same with Reflection, for more information check out
following tutorial:
http://samples.gotdotnet.com/quickst...oc/Invoke.aspx

--
Greetz,
Jan
__________________________________
Read my weblog: http://weblogs.asp.net/jan
"MFRASER" <mfraser@henwoodenergy.com> schreef in bericht
news:eAvDnop4DHA.2344@TK2MSFTNGP09.phx.gbl...[color=blue]
> Is there any CallbyName function inside of C#.
>
> I need to shift my items in a collection
>
> Psuedo code
> aItem has hours 1-24 and I need to be able to shift the hours.
> foreach(MapItem aItem in aCol.Items)
>
> {
>
> }
>
>
>
>[/color]


Rob Teixeira [MVP]
Guest
 
Posts: n/a
#3: Nov 15 '05

re: CallbyName in C#


You can use System.Reflection to get an object's member
(property/method/etc) by name, then use the Invoke method on the memberinfo
instance to call it.
However, I'm not sure I see a corillation between CallByName and what you
are trying to do in your loop.

-Rob Teixeira [MVP]

"MFRASER" <mfraser@henwoodenergy.com> wrote in message
news:eAvDnop4DHA.2344@TK2MSFTNGP09.phx.gbl...[color=blue]
> Is there any CallbyName function inside of C#.
>
> I need to shift my items in a collection
>
> Psuedo code
> aItem has hours 1-24 and I need to be able to shift the hours.
> foreach(MapItem aItem in aCol.Items)
>
> {
>
> }
>
>
>
>[/color]


Closed Thread


Similar C# / C Sharp bytes