Studio:Referring to global stride objects: Difference between revisions

From STRIDE Wiki
Jump to navigation Jump to search
No edit summary
 
m (Text replace - 'Category:Perl Info' to 'Category:Studio:Perl Info')
 
(4 intermediate revisions by 3 users not shown)
Line 1: Line 1:
The following variables are automatically injected when scripts are run in Studio, and must be referred to:
The following variables are automatically injected when scripts are run in [[STRIDE Studio]], and must be referred to:


$ascript
$ascript
$studio
$reporter
$testSuite


$studio
In '''Perl''', these variables must be qualified with the namespace (main::) in order for the script to run under strictures (invoked by including '''use strict''' in your script):  
 
$reporter
 
$panel
 
$testSuite
 
 
In Perl, these variables must be qualified with the namespace (main::) in order for the script to run under strictures (invoked by including use strict in your script):  


{|  
{|  
Line 22: Line 16:
|-  
|-  
| $reporter || $main::studio
| $reporter || $main::studio
|-
| $panel || $main::panel
|-
|-
| $testSuite || $main::testSuite
| $testSuite || $main::testSuite
|}
|}


Using use strict in scripts is recommended, as it catches a number of potential errors that might otherwise go undetected.  However, if strictures are not used, these global variables may be referred to without the main:: qualification.
Using '''use strict''' in scripts is recommended, as it catches a number of potential errors that might otherwise go undetected.  However, if strictures are not used, these global variables may be referred to without the main:: qualification.


For additional information on global variables on the target, click [[Accessing global variables|here]].
For additional information on global variables on the target, click [[How_do_I_access_global_variables%3F|here]].


[[Category:Scripting]]
[[Category:Studio:Perl Info]]

Latest revision as of 23:53, 20 August 2009

The following variables are automatically injected when scripts are run in STRIDE Studio, and must be referred to:

$ascript
$studio
$reporter
$testSuite

In Perl, these variables must be qualified with the namespace (main::) in order for the script to run under strictures (invoked by including use strict in your script):

Automatic variable Refer to as
$ascript $main::ascript
$studio $main::reporter
$reporter $main::studio
$testSuite $main::testSuite

Using use strict in scripts is recommended, as it catches a number of potential errors that might otherwise go undetected. However, if strictures are not used, these global variables may be referred to without the main:: qualification.

For additional information on global variables on the target, click here.