Click to See Complete Forum and Search --> : Variable Help ???


Jim078
September 22nd, 2001, 12:37 PM
I am trying to write a code statement that will create a variable called total to be used in multiple subroutines with a data type of short. thanks

srinika
September 23rd, 2001, 09:50 PM
The variable type should be either byte or integer
Byte : An integer value between 0 and 255
Integer : A value in the range -32,768 to 32,767

The scope of the variable depends on the task that u want to perform with those variables.
* If all subroutines u want to use the variable are in a single form(or in a single module)
- u can define within the subroutines and pass as parameters
- u can define in the general declaration area of the form (or in the module) in the following format Dim iTotal as Integer


* If all subroutines u want to use the variable are in different forms (or in different modules/forms)
- u can define within the subroutines and pass as parameters
- u can define in the form (or in the module) in the following format public iTotal as Integer

Whenever used, use it with the form name in the first part (in the case of defined in the form)
Eg. Form1.iTotal = 17


IS THIS ENOUGH?
Srinika