|
|
Appendix 1: Special Characters
Since the dollar sign $ is used to identify variables by prefixing variable names (see lesson10), one needs some other way of showing the dollar character in one's WML output. What one does is to write double dollar signs $$ in place of single dollar signs. Note that the pair cannot be mistaken for a variable, as variable names cannot start with $.
There are various other special characters which, because they are part of the WML syntax, must be specified in an alternative way. The following table gives a list of characters with their alternative notations (nb. a nonbreaking space is use to stop the microbrowser breaking between some text which you wish to keep on the same line, and a soft hyphen marks a place in a long word where you will allow the microbrowser to create a break).
|
&
|
&
|
|
"
|
"
|
|
'
|
'
|
|
<
|
<
|
|
>
|
>
|
|
Nonbreaking space
|
|
|
Soft hyphen
|
­
|
The characters given above are unusual in having quasi-readable alternative notations. A more general solution is to give the character number (the ASCII number or, if the handset supports it, the Unicode number) in either a decimal or hexadecimal format. For instance, the 'greater than' sign > can be coded as the decimal >, or the hexadecimal >. One can't, however, use this trick to output a dollar sign - we still have to use the notation given in the first paragraph (ie $$ to represent $). The reason for this is that the microbrowser converts special characters before it replaces any variables.
|
|
|
|