14.03.2014 Views

Scripting Guide - SAS

Scripting Guide - SAS

Scripting Guide - SAS

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 8 Programming Methods 203<br />

Advanced Scoping and Namespaces<br />

)<br />

);<br />

Circle( {0, 0}, Sqrt( window:gx * window:gx + window:gy * window:gy ) );<br />

);<br />

);<br />

Figure 8.1 Example of Current Window Namespace<br />

Example of Using the Here Scope<br />

This example uses the Here scope to pass information between windows that are created by the same script.<br />

Scoping a variable using Here: is not dependent on turning Names Default To Here() on. The Here:<br />

scope is always available.<br />

This script produces two windows and uses two different scopes.<br />

The Launcher window asks the user for two values. Those two values are passed to the Output window,<br />

which uses them to graph a function. The Launcher window scopes aBox and bBox to the window:<br />

essentially, those two variables (pointers to Number Edit Boxes) exist only in the Launcher window and are<br />

not available to the Output window. The values from those two boxes are then copied into variables that are<br />

scoped to Here, and so are available to both windows that are produced by this script.<br />

launchWin = New Window( "Launcher",<br />

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!