473,668 Members | 2,290 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

CallbyName in C#

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)

{

}


Nov 15 '05 #1
2 2482
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" <mf*****@henwoo denergy.com> schreef in bericht
news:eA******** ******@TK2MSFTN GP09.phx.gbl...
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)

{

}

Nov 15 '05 #2
You can use System.Reflecti on 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" <mf*****@henwoo denergy.com> wrote in message
news:eA******** ******@TK2MSFTN GP09.phx.gbl...
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)

{

}

Nov 15 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
12100
by: Edlueze | last post by:
I use the CallByName function quite regularly, but the sub routines that I have always called have been located within the form code. The call I use looks something like this: Dim CallObjectForm As Form Set CallObjectForm = Forms("My Form") CallByName CallObjectForm, "My_Form_SubRoutineCall", VbMethod I now want to call code that is located within a standard module and I am not having any luck. I'm trying to use the following code:
12
11224
by: Jelle van Baardewijk | last post by:
Does anybody know if there's way to do this in C#? Jelle van Baardewijk
1
2394
by: Kishor | last post by:
Hi all, I am facing one problem with callbyName. I am facing one problem, instead of describing this I am pasting this code. I wanted to know is there any other way to avoid this error and make generalized functions. Please see the code.
8
6378
by: Rob R. Ainscough | last post by:
I use a generic Processing form (modal) where I pass it an object and method name and parameters if needed and then use CallbyName to execute the passed in method. What this does for me is lock out user input on the parent form as the Processing form has no input controls until all processing is complete. I was curious if CallByName is a good way to perform this operation?
0
1236
by: Phill. W | last post by:
I have a Console application (which will wind up running on a remote host). This has two Threads - the main processor and a second that provides a socket-based way of "talking" to the first. This is my first foray into multi-threading where threads need to talk to one another. In the main thread, for one "reason" or another, I have a method that internally uses
1
1682
by: Fredrik Melin | last post by:
Hi, We had real bad problems with reports being printed wrong (active reports ..net 2.0), which we tracked down to being because before we printed the report we used CallByName to READ properties from the Business Object that the report was based on. When I replaced the old CallByName's call with a small Reflection code instead, the problem went away.
0
1217
by: Tim | last post by:
If I use CallByName, and the function that is called contains runtime errors, I don't get the code to pause and debug at the point of the error, rather at the callbyname line. This makes debugging really very tricky. Am I doing something wrong? Is there an obvious fix to enable the pause on error to pause at the right place?
1
1754
by: Timberwoof | last post by:
For i = 1 To 3 CallByName(Form1.Controls("ComboBox" & i), "items.add", Type.Set, "1st item") CallByName(Form1.Controls("ComboBox" & i), "items.add", Type.Set, "2nd item") CallByName(Form1.Controls("ComboBox" & i), "items.add", Type.Set, "3rd item") next Is there a way I can populate these 3 combo boxes using the CallByName feature. My form has 3 combo boxes named ComboBox1, ComboBox2, ComboBox3. I would really Prreeeeeeciate your...
0
8836
by: penguinie | last post by:
First add to referance Microsoft.VisualBasic using System; using System.Collections.Generic; using System.Text; using Microsoft.VisualBasic; using Microsoft.VisualBasic.CompilerServices; namespace CallByNameConsole {
0
8459
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8378
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8791
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
6206
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4202
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4376
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2786
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2018
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1783
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.