Wmlscript Specification Approved Version 04-Nov-1999
Total Page:16
File Type:pdf, Size:1020Kb
WMLScript Specification Approved Version 04-Nov-1999 Wireless Application Protocol WMLScript Language Specification Version 1.1 Disclaimer: This document is subject to change without notice. Approved Version 04-Nov-1999 Page 2(132) 1. CONTENTS 1 . ................................................................................................................................................Scope 7 2 . ...............................................................................................................................Document Status 8 2.1 Copyright Notice..................................................................................................................... 8 2.2 Errata ..................................................................................................................................... 8 2.3 Comments .............................................................................................................................. 8 3 . ........................................................................................................................................References 9 3.1 Normative references ............................................................................................................. 9 3.2 Informative References .......................................................................................................... 9 4 . ............................................................................................................ Definitions and abbreviations 10 4.1 Definitions ............................................................................................................................ 10 4.2 Abbreviations........................................................................................................................ 11 5 . ........................................................................................................................................... Overview 12 5.1 Why Scripting? ..................................................................................................................... 12 5.2 Benefits of using WMLScript ................................................................................................ 12 6 . ................................................................................................................................WMLScript Core 13 6.1 Lexical Structure................................................................................................................... 13 6.1.1 ....................................................................................................................Case Sensitivity 13 6.1.2 ............................................................................................... Whitespace and Line Breaks 13 6.1.3 ........................................................................................................... Usage of Semicolons 13 6.1.4 ............................................................................................................................Comments 14 6.1.5 ..................................................................................................................................Literals 14 6.1.5.1 ...................................................................................................................Integer Literals 14 6.1.5.2 ........................................................................................................Floating-Point Literals 15 6.1.5.3 .................................................................................................................... String Literals 15 6.1.5.4 ................................................................................................................ Boolean Literals 16 6.1.5.5 ..................................................................................................................... Invalid Literal 17 6.1.6 ..............................................................................................................................Identifiers 17 6.1.7 .................................................................................................................. Reserved Words 18 6.1.8 .......................................................................................................................Name Spaces 18 6.2 Variables and Data Types .................................................................................................... 18 6.2.1 ............................................................................................................. Variable Declaration 18 6.2.2 ................................................................................................ Variable Scope and Lifetime 19 6.2.3 ....................................................................................................................Variable Access 19 6.2.4 ....................................................................................................................... Variable Type 19 6.2.5 ............................................................................................................................... L-Values 19 6.2.6 .................................................................................................................Type Equivalency 20 6.2.7 .................................................................................................................... Numeric Values 20 6.2.7.1 ....................................................................................................................... Integer Size 20 6.2.7.2 .............................................................................................................Floating-point Size 20 6.2.8 ........................................................................................................................String Values 21 6.2.9 .................................................................................................................... Boolean Values 21 6.3 Operators and Expressions.................................................................................................. 21 6.3.1 ..........................................................................................................Assignment Operators 21 6.3.2 ............................................................................................................ Arithmetic Operators 22 6.3.3 .................................................................................................................Logical Operators 23 6.3.4 ...................................................................................................................String Operators 24 6.3.5 ......................................................................................................... Comparison Operators 24 6.3.6 ....................................................................................................................Array Operators 24 6.3.7 ..................................................................................................................Comma Operator 25 © Wireless Application Protocol Forum, Ltd, 1999 All rights reserved. Approved Version 04-Nov-1999 Page 3(132) 6.3.8 ............................................................................................................ Conditional Operator 25 6.3.9 .................................................................................................................... typeof Operator 25 6.3.10 .................................................................................................................. isvalid Operator 26 6.3.11 ........................................................................................................................Expressions 26 6.3.12 ...........................................................................................................Expression Bindings 26 6.4 Functions.............................................................................................................................. 28 6.4.1 ........................................................................................................................... Declaration 28 6.4.2 ...................................................................................................................... Function Calls 29 6.4.2.1 .......................................................................................................Local Script Functions 29 6.4.2.2 ............................................................................................................ External Functions 30 6.4.2.3 ...............................................................................................................Library Functions 30 6.4.3 ............................................................................................................Default Return Value 31 6.5 Statements ........................................................................................................................... 31 6.5.1 ..................................................................................................................Empty Statement 31 6.5.2 .......................................................................................................... Expression Statement 31 6.5.3 ................................................................................................................... Block Statement 32 6.5.4 ...............................................................................................................Variable