I could only find "Global Scripts" under the "Meta Data Source" and "Scripting Data Source" wiki headings. Consequently, it is unclear which of the "Scripting Data Source" recommendations also apply to global scripts (and also why I did not think to look at the icon bar for the Global Scripts). Specifically, the Scripting Data Source states:
Note how the typeof function is used to determine if constants need to be defined. This is an effective way of initializing the script context upon startup of the data source.
if (typeof(rho) == "undefined") {
rho = 28;
sigma = 10;
beta = 8/3;
dt = 0.01;
}
I have defined functions containing equations in Global Scripts. They contain implicit constant definitions. For example:
return (2.43941E-7*W3 -0.5433*W2 +0.06*W+2.0)
The function seems to be working fine, but I'm concerned about the "effective way" cited on the Scripting Data Source page. Should I pull those constants out of the equation and declare them within a typeof structure? What are the implications of not doing that? Performance? Memory? Memory leaks? Why is this recommended for a Scripting Data Source? Speed?
Thanks.