Global declaration? 
Author Message
 Global declaration?

Hi how do I declare c++ like global declaration in VB?
I am trying to call a procedure to get some input from user then
return values to main procedure but I am having problem doing this.
Please help.


Mon, 13 Sep 2004 23:17:15 GMT  
 Global declaration?

Quote:

> Hi how do I declare c++ like global declaration in VB?
> I am trying to call a procedure to get some input from user then
> return values to main procedure but I am having problem doing this.
> Please help.

if you are using a subroutine or function you should pass the values
required.

example

private sub MY_Input_routine(my_input as string)
'
' get user input
'
my_input = xxx ' xxx is user input

end sub

when you do a call MY_input_routine(my_value)

the variable my_value will contain the user input.
This keeps all variables local and helps to identify when values are
being passed.

The other way is to put a DIM my_value as string (or whatever) in the
declarations section of your form. This seems to make it global.



Tue, 14 Sep 2004 05:36:30 GMT  
 Global declaration?
If you want a true global then you will have to put the
declaration in a .BAS module.  Then you will have to set the
program start-up options to start with the Sub Main() in your
Module.  This will make the variable global and accessible from
any form in your app.

Scott


| Hi how do I declare c++ like global declaration in VB?
| I am trying to call a procedure to get some input from user
then
| return values to main procedure but I am having problem doing
this.
| Please help.



Tue, 14 Sep 2004 22:46:27 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Global Declarations

2. Global Declarations

3. Global Declarations

4. Global Declarations

5. PLEASE HELP ME!! with Access97 global declaration for all forms...

6. PLEASE HELP ME!! with Access97 global declaration for all forms...

7. Problem with global variable declaration

8. Global Variable Declaration

9. Global database object declaration?

10. tool to convert VC Dll functions declarations to VB declarations

11. Global.MPT and Enterprise Global Template

12. Refering to Functions and Subs held in one global template from another global template

 

 
Powered by phpBB® Forum Software