How do I declare a static global variable ? 
Author Message
 How do I declare a static global variable ?

I want to declare a static global variable in a form
that will be

1. initialized properly
2. accessed from various controls event procedures

I tried Static Global LargestValueUsed As Integer but it does not work
and I can't figure out the initialization.
I want to do

if LargestValueUsed is not initialized then set it to the largest
        value found in table T for field F
else do nothing

Then I want to use LargestValueUsed in various event procedures.

I am willing to write a function GetLargestValueUsed()
that will return the value. Then I only need static.

I'd like to know both.

        Vania

=========================================================

http://www.*-*-*.com/ ~vania   Fax:+33 47 651 0532



Sun, 20 Feb 2000 03:00:00 GMT  
 How do I declare a static global variable ?

Global variables are always "static" in that their values are preserved in
memory until the application is closed.  The Global key word is all you
need, but global variables must be declared in the declarations section of
the module and not within a procedure.  The static keyword is used to make
a variable declared within a procedure persist between procedure calls.
--

Developer: Inter-Tec Software Services
 ( Remove ".NOSPAM" from address to reply via e-mail )



Quote:
> I want to declare a static global variable in a form
> that will be

> 1. initialized properly
> 2. accessed from various controls event procedures

> I tried Static Global LargestValueUsed As Integer but it does not work
> and I can't figure out the initialization.
> I want to do

> if LargestValueUsed is not initialized then set it to the largest
>    value found in table T for field F
> else do nothing

> Then I want to use LargestValueUsed in various event procedures.

> I am willing to write a function GetLargestValueUsed()
> that will return the value. Then I only need static.

> I'd like to know both.

>    Vania

> =========================================================

> http://www.gr.opengroup.org/~vania   Fax:+33 47 651 0532



Tue, 22 Feb 2000 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Declaring variables as Static vs Private/Public -- XML

2. declare global variables

3. How do you declare a global variable in the constants module

4. declaring global variables

5. declaring global variables/constants?

6. Declaring Global Variables

7. Cannot assign a variable declared as a string to a variable declared as data type

8. help: how and where to declare a global variable

9. How to declare global variables ?

10. How to declare global variables ?

11. How do i declare global variables

12. How do i declare global variables

 

 
Powered by phpBB® Forum Software