Re: Global & Module variables in WR
First, what is a "Module" variable?
You have Two Types "Text" and "Numbers" (period).
You have Four "Variable Types" (period).
# Example ...
VarName1 = "SomeValue";
# VarName1 is accessable from any "Test Script" or Compiled Module that is run after the above statements. In a "Compiled Module" you need to pass the variable into the Function or define it as "extern" in the function. One exception is that you can define a variable at the Top of the "Comipled Module" and it has the scope you have defined it with. I have seen issues where "extern" needs to be defined outside of the Function at th Top of the Compiled Module.
From on-line help:
Declaration Scope Lifetime Declare the variable in...
Auto Local End of function function
Static Local Until stop function, test, or module
Public Global Until stop test or module
Extern Global Until stop function, test, or module variables: declarations
auto: An auto variable can only be declared within a function and is local to that function. It exists only as long as the function is running. A new copy of the variable is created each time the function is called.
static: A static variable is local to the function, test, or compiled module in which it is declared. The variable retains its value until the test is terminated by a Stop command.
public: A public variable can only be declared within a test or module, and is available for all functions, tests, and compiled modules.
extern: An extern declaration indicates a reference to a public variable declared outside of the current test or module.
With the exception of the auto variable, all variables continue to exist until the Stop command is executed. For example, the statement
cranem451 - email@example.com
Global & Module variables in WR
Could anyone tell me how to create Global and Module variables using WinRunner tool, and what are these variables used for..
Thanks in Advance