First add to referance Microsoft.VisualBasic - using System;
-
using System.Collections.Generic;
-
using System.Text;
-
using Microsoft.VisualBasic;
-
using Microsoft.VisualBasic.CompilerServices;
-
-
namespace CallByNameConsole
-
{
-
class _TEST
-
{
-
private string _STR = "Called By The Name";
-
-
public string _TESTSTR {
-
get {
-
return _STR;
-
}
-
set {
-
_STR = value;
-
}
-
}
-
public string _FUNCTION(int _X, int _Y) {
-
return (_X * _Y).ToString();
-
}
-
public void _PROCEDURE(int _X, int _Y) {
-
_Y *= _X;
-
}
-
-
}
-
class Program
-
{
-
static void Main(string[] args)
-
{
-
Console.Clear();
-
-
_TEST _TESTER = new _TEST();
-
-
string _STRING;
-
-
_STRING = Versioned.CallByName(_TESTER, "_TESTSTR", CallType.Get).ToString();
-
-
Console.WriteLine("Get _TESTSTR in _TEST : {0}",_STRING);
-
-
Versioned.CallByName(_TESTER, "_TESTSTR", CallType.Set, "Changed By The CallByName");
-
-
_STRING = Versioned.CallByName(_TESTER, "_TESTSTR", CallType.Get).ToString();
-
-
Console.WriteLine("Set _TESTSTR in _TEST : {0}",_STRING);
-
-
_STRING = (String)Versioned.CallByName(_TESTER, "_FUNCTION",CallType.Method, 2, 3);
-
-
Console.WriteLine("Use _FUNCTION function in _TEST : {0}*{1}={2}",2,3,_STRING);
-
-
int _A = 3, _B = 3;
-
-
Versioned.CallByName(_TESTER, "_PROCEDURE", CallType.Method, _A, _B);
-
-
Console.WriteLine("Use _PROCEDURE sub in _TEST {1}={0}*{1}",3,3,_A.ToString());
-
-
Console.ReadLine();
-
}
-
}
-
}
--------------------------------------------------------------------
Başak & Gökhan Tarhan
Software Development Specialists
0 8813 Sign in to post your reply or Sign up for a free account.
Similar topics
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...
|
by: Jelle van Baardewijk |
last post by:
Does anybody know if there's way to do this in C#?
Jelle van Baardewijk
|
by: MFRASER |
last post by:
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...
|
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...
|
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...
|
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.
...
|
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...
|
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...
|
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")...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
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,...
|
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...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
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...
| |