Forum Discussion
kumar_perlaa
14 years agoContributor
Hello Tanya,
Thanks for the code snippet. That's the one way to access global variables in many methods. if all variables are declared in the same file (unit) with global scope.
Let's take a same example and assume that Test5() defined in file 2.
Code Snippet for Test5()
// Test5() declared in file2(Unit 2) and All above methods are in file1(Unit1).
if i include file1 in file2 ,it will work as per C++ syntaxt,but JScript is not allowing Cross reference. is there any work around solution for this...Please let me know?
Thanks for the code snippet. That's the one way to access global variables in many methods. if all variables are declared in the same file (unit) with global scope.
Let's take a same example and assume that Test5() defined in file 2.
Code Snippet for Test5()
// Test5() declared in file2(Unit 2) and All above methods are in file1(Unit1).
if i include file1 in file2 ,it will work as per C++ syntaxt,but JScript is not allowing Cross reference. is there any work around solution for this...Please let me know?
#include<file1.h>
function Test5()
{
Log.Message("a=" + a + "; b=" + b + "; c=" + c +"; d=" + d);
a = a + 1;
b = b + 1;
c = c + 1;
d = d + 1;
Log.Message("a=" + a + "; b=" + b + "; c=" + c +"; d=" + d);
}