473,513 Members | 2,356 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Mysettings passed to a function or sub

4 New Member
Hello first of all thank you for your time in reading this post.

My problem is that i have a setting called 'altitude'. I want to pass this setting to another function or sub, but i cant seem to work out how.

ie:
private sub SomeStuff(setting as my.mysettings)

where settings would be 'altitude'

I realise that this is a basic thing, but i just cant work out how to do it. Please help me.

Tim
Feb 27 '07 #1
6 1463
Killer42
8,435 Recognized Expert Expert
Could you please fill in some details? For instance...
  • What version of VB?
  • What does "my.mysettings" represent? Is this a structure that your "setting" reside within?
  • Can you show us the code you have so far? This might help.
Feb 28 '07 #2
willakawill
1,646 Top Contributor
Hello first of all thank you for your time in reading this post.

My problem is that i have a setting called 'altitude'. I want to pass this setting to another function or sub, but i cant seem to work out how.

ie:
private sub SomeStuff(setting as my.mysettings)

where settings would be 'altitude'

I realise that this is a basic thing, but i just cant work out how to do it. Please help me.

Tim
Hi Tim. Need to know the data type for this variable. It is unlikely to be 'my.mysettings'
Feb 28 '07 #3
vijaydiwakar
579 Contributor
Hello first of all thank you for your time in reading this post.

My problem is that i have a setting called 'altitude'. I want to pass this setting to another function or sub, but i cant seem to work out how.

ie:
private sub SomeStuff(setting as my.mysettings)

where settings would be 'altitude'

I realise that this is a basic thing, but i just cant work out how to do it. Please help me.

Tim
to pass address of any fun or sub use addressof function
try it
Feb 28 '07 #4
willakawill
1,646 Top Contributor
to pass address of any fun or sub use addressof function
try it
That does not appear to be what the op is asking.
Feb 28 '07 #5
TimothyDoran
4 New Member
Hello thanks for the responces.

I am using vb.net, i think that i should have really put this in the .net part of the forum

my.mysettings.**** is the method for retrieving user.config settings. I can read and write to these no problem.

altitude is a string setting with a short string of characters. There are also other settings

What i want to do is pass my.mysettings.altitude to another sub or function.
Feb 28 '07 #6
willakawill
1,646 Top Contributor
Hello thanks for the responces.

I am using vb.net, i think that i should have really put this in the .net part of the forum

my.mysettings.**** is the method for retrieving user.config settings. I can read and write to these no problem.

altitude is a string setting with a short string of characters. There are also other settings

What i want to do is pass my.mysettings.altitude to another sub or function.
Ok Timothy. No problem. Now that we know the data type the rest is easy.
So my.mysettings.altitude is a string. We can pass it as a parameter to any function that takes a string as a parameter.

Expand|Select|Wrap|Line Numbers
  1. Sub anyfunction(mystring As String)
  2.    'blah blah blah
  3. End Sub
Then we can call it with the altitude parameter
Expand|Select|Wrap|Line Numbers
  1. anyfunction my.mysettings.altitude
Bingo
Feb 28 '07 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

1
1456
by: Marcello Pietrobon | last post by:
Hello, My background is C++ I would like to know for sure if it is possible to pass a value by reference to a function AND having it changed by the function itself def changeValue( text...
3
1842
by: jimjim | last post by:
Hello, My question concerns as to how a pointer is passed by reference as a function argument. The following is from code taken from the MICO implementation of the CORBA specification. in...
2
4257
by: cmay | last post by:
I have an asp.net application at the root, and other applications suchs as /WebApp1, /WebApp2. By design, these web applications inherit the root application's web.config file. But, when you...
1
5675
by: Monty | last post by:
Hello, I have a class that exposes several values like so: Public Shared ConnString As String The class, originally enough, is named "Settings". If I interrogate a value of this object in the...
0
7175
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
7391
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
7553
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...
1
7120
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...
0
5697
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
4754
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
3235
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
809
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
466
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.