Page 163 - DCAP512_WAP_AND_WML
P. 163

Unit 11: Using WML Script




          Self Assessment                                                                       Notes

          Fill in the blanks:
          10.  ………………………. is the name specified for the function.
          11.  You can use the optional ………………………. keyword to specify that a function is to be
               externally accessible.
          12.  WMLScript supports the use of ………………………. that specify compilation unit level
               information.
          13.  The  standard String  library  supports  functions by which array-like  behavior can  be
               implemented using ……………………….

          11.4 Using WMLScript Libraries


          11.4.1 Script Libraries

                                            Table  11.4

                        Library          Description
                        Lang             Constants, math functions, etc.
                        Float            Floating point math functions
                        String           String processing functions
                        URL              URL processing
                        WML Browser      Browser interface, links to WML Script
                        Dialogs          Basic user interactions

          Dialog Library

                                             Table  11.5

             alert()     Displays a message, waits for a confirmation, and then returns an empty string
             confirm()   Displays a message, waits for an answer, and returns a Boolean value depending
                         on the selected answer
             prompt()    Displays a question, waits for an input, and then returns the user’s answer

          Float Library
                                            Table  11.6

              sqrt()        Returns the square root of a specified number
              floor()       Returns the nearest integer that is not larger than a specified number
              int()         Returns the integer part of a specified number
              ceil()        Returns the nearest integer that is not smaller than a specified number
              maxFloat()    Returns the largest possible floating point number
              minFloat()    Returns the smallest possible floating point number
              pow()         Raises a number to the power of a second number and returns the result
              Round()       Returns the nearest integer to a specified number



                                           LOVELY PROFESSIONAL UNIVERSITY                                   157
   158   159   160   161   162   163   164   165   166   167   168