Hi.
Here is a sample program containing a Function GetWeight(). Is there anyway that a Function can access ALL program Variables such as Var1, Var2, and String1 in this example ?
Code: Select all
Dim As Integer Var1, Var2, Weight, W
Dim As String String1, String2
Public Function GetWeight() As Integer
Dim As Integer Weight = 20
Var1 = Weight * Var2 'Defined Outside Of This Function
String1 = "Changed in Function" ''Defined Outside Of This Function
Return Weight
End Function
' Program Begins
Var1 = 87 : Var2 = 12 : Weight = 11
String1 = "String1" : String2 = "String2"
W = GetWeight
Print W, Var1, Var2, String1, String2
Thanks,
M....