WMLScript Language Rules

Preferences - Do not show ads

WMLScript is developed based on ECMAScript, which is the standardized version of JavaScript. Thus, WMLScript's language rules are very similar to that of JavaScript.

Semicolons at the End of WMLScript Statements

A semicolon is required to end a statement in WMLScript. This is the same as C++ and Java. Note that JavaScript does not have such requirement. In JavaScript, semicolons are optional. The following code is taken from the earlier "Hello World" example. You can see that the two WMLScript statements in this function are ended with semicolons.

extern function helloWorld()
  WMLBrowser.setVar("message", "Hello World. Welcome to our WMLScript tutorial.");

Whitespaces in WMLScript

Except in string literals, WMLScript ignores extra whitespaces like spaces, tabs and newlines. Hence, the code in the earlier "Hello World" example can be typed in the following way and the result will remain the same:

extern     function helloWorld()
   "Hello World. Welcome to our WMLScript tutorial.");

Case Sensitivity in WMLScript

The WMLScript language is case-sensitive. For example, a WMLScript function with the name WMLScript_Function is different from wmlscript_function. So, be careful of the capitalization when defining or referring to a function or a variable in WMLScript.

Page 4 of 71 Previous Page | Next Page
Contents at a Glance
Print this Web Page | | Back to Top

Feedback Form (Expand)

What do you think about this web page?

WMLScript Tutorial Table of Contents WMLScript Tutorial Contents at a Glance Preferences - Change Color Scheme Preferences - Do Not Show Ads Previous Page Next Page