473,505 Members | 13,807 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Passing variable between class and class caller

I have inherited a piece of code that i now have to modify.

One of the changes i have to make requires me calling a function to
return a value (i.e., bln_Val)

I then call a class in a different project that has numerous methods.
These methods (functions) are called one by one as part of the flow of
the code. what i want to do is to access my value (bln_Val) in one of
these methods.

how do i pass in by value to the new class or retrieve my value from
the first calling class and make it accessible in the 2nd class.

any help or code samples appreciated.

CG

Nov 21 '05 #1
1 946
<cs********@gmail.com> wrote in message
news:11**********************@g49g2000cwa.googlegr oups.com...
I then call a class in a different project that has numerous methods.
These methods (functions) are called one by one as part of the flow of
the code. what i want to do is to access my value (bln_Val) in one of
these methods.
Just pass the value as an argument to the method. If the method
might /change/ that value, pass it By Reference.
how do i pass in by value to the new class or retrieve my value
from the first calling class and make it accessible in the 2nd class.


Don't even /think/ about the second option.
You're 2nd class would have to know quite a /lot/ about what was
calling it to make this work.

HTH,
Phill W.
Nov 21 '05 #2

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

Similar topics

4
13528
by: Andrew Chalk | last post by:
I am a raw beginner to Python. I just read in "Learning Python" that assigning to a string argument inside a function does not change the string in the caller. I want an assignment in the function...
3
16811
by: Andy Read | last post by:
Dear all, I thought I understood passing parameters ByVal and ByRef but I clearly don't! If I define a simple class of: Public Class Person Public Name as String Public Age as Integer End...
5
36376
by: Andy | last post by:
Hi Could someone clarify for me the method parameter passing concept? As I understand it, if you pass a variable without the "ref" syntax then it gets passed as a copy. If you pass a...
13
17903
by: Abe Frohnman | last post by:
Hello all, I'm passing a reference to a class into the constructor of a form, like so: public MyForm(int count, ref Area myArea) {...} How can I use myArea outside the constructor? Should I...
2
17961
by: Chris | last post by:
I have two forms. From form one I have a listbox that when double clicked I get the selected value (string) and store in a variable. I parse the string to get the first 12 characters and store it...
6
2828
by: Lenn | last post by:
Hi, Could someone clarify my confusion regarding passing reference types to a method with ref keyword and explain when it's practical to use it. It's my understanding that in .NET reference...
1
1158
by: jg | last post by:
I have searched marshaling articles from MSDN and Google but I am stuck with solving my problem to marshal arrays to COM caller from my managed COM class I built a .net COM class in VB and...
1
358
by: jconnort | last post by:
I'm trying to write a function to get the current system time, so I can use it when I need to output it to a log, below is the code I'm testing: #include "include.h" #include <stdlib.h> ...
22
3450
by: tshad | last post by:
If I am passing a variable by reference to another routine by reference, do I need to dereference first? string testString; .... FirstSub(ref firstString) { HandleString(ref firstString); ...
3
2386
by: DaTurk | last post by:
If I call this method, and pass it a byte by ref, and initialize another byte array, set the original equal to it, and then null the reference, why is the original byte array not null as well? I...
0
7098
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...
0
7298
Oralloy
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,...
0
7366
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...
0
7471
tracyyun
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...
0
5610
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4698
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3187
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...
1
754
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
406
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...

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.