SoFunction
Updated on 2025-04-07

WMLScript Script Programming Page 1/9

As an editing language, WMLScript provides powerful functions, statements and library functions, as well as external editing, access control and other support. It also provides detection methods and specific solutions for possible errors during program operation. These contents belong to WMLScript's script programming knowledge and further programming regulations, which we will introduce in detail in this chapter.
5.1 Statement
We have learned variables, operators and expressions earlier, but these contents alone cannot complete a complete function because they cannot form complete operations or processing programs. Variables are like serious words, expressions such as phrases in language, and they cannot express a complete meaning; only sentences are complete sentences in language, which can express a complete meaning and realize a complete function. WML Script provides rich statement functions. Using these statements we can establish interactive functions and other complex functions required in WML cards.
In WML Script, each statement needs to end with a semicolon (;). In order to develop a rigorous programming style, it is recommended that you must add a semicolon (;) after the statement when writing scripts, which also helps us to form a good programming habit.
The writing and arrangement format of WML Script statements is relatively free. We can write multiple statements in succession in the same program line, or we can divide the same statement into multiple lines. WML Script will determine the specific content of the statement based on the semicolon (;).
WML Script statements mainly include two categories. The first category is basic statements, such as empty statements, expression statements, block statements, variable statements and return statements, etc.; the second category is conditional statements, such as if statements; the third category is loop statements, such as while statements, for statements, break statements and continue statements, etc. Below we explain the syntax, function and usage methods of these statements respectively.
5.1.1 Basic statements
Basic WML Script statements are mainly used for program format control and variable declarations, and some of them are no longer unfamiliar with them.
Abortion statement
An empty statement is used to define an empty program line that does not have any identifiers and operators, and does not perform any operations. It just ends with a semicolon (;). Its syntax format is:
;
Obviously, an empty statement is a very special statement. Therefore, in order to make the program more readable, we usually add a few empty statements to appropriate places in the program to separate or highlight. For example, the following lines of the program contain an empty statement:
str="Hello";
val=25;
;
MyVal=val*val+5;
alert("Hi,Hi!!!");
123456789Next pageRead the full text