Proceed to WirelessDevNet Home Page
Publications, e-books, and more! Community Tutorials Store Downloads, tools, & Freebies! IT Career Center News Home
newnav.gif

Newsletters
EMail Address:



   Content
  - Articles
  - Columns
  - Training
  - Library
  - Glossary
 
   Career Center
  - Career Center Home
  - View Jobs
  - Post A Job
  - Resumes/CVs
  - Resource Center
 
   Marketplace
  - Marketplace Home
  - Software Products
  - Wireless Market Data
  - Technical Books
 
   News
  - Daily News
  - Submit News
  - Events Calendar
  - Unsubscribe
  - Delivery Options
 
   Community
  - Discussion Boards
  - Mailing List
  - Mailing List Archives
 
   About Us
  - About WirelessDevNet
  - Wireless Source Disks
  - Partners
  - About MindSites Group
  - Advertising Information
 
INDEX
>Introduction
>The WML Deck
>The WMLScript Program
>Debugging The WMLScript
>Lessons Learned
>Conclusion

Writing A Multi-Currency Converter Using WMLScript

by Wei Meng LEE

Introduction

In the past few months, we have seen a lot of articles describing how WMLScript can be used to perform client-side validation and complement WML applications that runs on a WAP device. One particular application that is very popular is a currency converter. However, the conventional currency converter usually hardcodes the exchange rate in the WMLScript program. Once the WMLScript is downloaded onto the device, it is cached and any changes to the currency conversion rate would not be reflected in the application.

In this article, I will illustrate how you can use ASP to create a truly "dynamic" WMLScript program using the currency converter application as a case study. Our currency converter is able to reflect the daily changes in the exchange rates.

The Application

The currency converter application is typically used to illustrate the use of WMLScript. For this article, I will use the UP.Simulator provided by Phone.com. The following figures illustrate our application:

   

   

The user simply chooses the currency to convert from, punch in the amount to be converted and selects the target currency and the converted currency would then be displayed.

The Database

Our application makes use of a database containing a single table named Conversion.

This table simply contains the exchange rate of currencies. The exchange rate is tagged to a fixed currency, the Singapore dollar (SIN), in this case. For example:

1 USD (US Dollar)= 1.73 SIN (Singapore Dollar) 1 RM (Malaysian Ringgit)= 0.48 SIN

Converting from one currency to another is a two-step process. For example, to convert 15 USD to RM, first convert the USD to SIN:

15 * 1.73 = 25.95 SIN

Then convert the SIN to RM:

25.95 / 0.48 = 54.0625 RM

The Conversion table contains two fields: Currency and SinEquiv. The Currency field contains the currency name while the SinEquiv field contains the equivalent amount of the currency in Singapore dollar.

Next: The WML Deck

Sponsors

Search

Eliminate irrelevant hits with our industry-specific search engine!









Wireless Developer Network - A MindSites Group Trade Community
Copyright© 2000-2010 MindSites Group / Privacy Policy
Send Comments to:
feedback@wirelessdevnet.com