June 17, 2000 - Compilation Units and Pragmas
June 17, 2000|
Compilation Units and Pragmas
Tips: June 2000
Yehuda Shiran, Ph.D.
use url pragma specifies the location (URL) of the external WMLScript resource and gives it a local name. This name can then be used inside a function declarations to make external function calls. Let's examine the following example:
The sequence of operations that take place here is fairly intuitive. The
use url pragma specifies a URL to a WMLScript compilation unit,
.wmlsc, i.e. it will look for
.wmls file extension and their compilation results are stored under
Once the file is found, the function call
DocJS#mydiv() triggers the loading of the external compilation unit,
mydiv() function, and it is actually executed with the calling parameters,
mydiv(nom, denom). The
use url pragma has its own name space for local names, but they must be unique within the same compilation unit.
For more on WMLScript, go to WMLScript Primer.