spacer

Webref WebRef   Sitemap · Experts · Tools · Services · Newsletters · About i.com

home / experts / javascript / column62


WMLScript Primer

Developer News
News Flash: Adobe Has iPhone Workaround
Adobe's Flash 10.1 Goes Mobile (Minus iPhone)
A Salute to Visionary CEOs

WMLScript-Specific Literals and Operators

WMLScript supports several literals that are not included in JavaScript. The invalid value is one of them. When you divide a number by zero, you get the invalid value. You also get it if an operation results in a floating-point number that is not part of the set of finite real numbers supported by the single-precision floating-point format. In fact, any data type conversion failure results in a returned value of invalid.

The typeof operator in JavaScript returns a string representing the variable type. In WMLScript, this operator return an integer value:

TypeCode
Integer0
Floating Point1
String2
Boolean3
Invalid4

The intrinsic function isvalid returns true if the type of the expression is valid, false if the expression is not valid. The following example demonstrates the new token:

var str = "Doc JavaScript";
var ok = isvalid(str);  // true
var tst = isvalid(1/0); // false

Next: How to construct compilation units and pragmas

http://www.internet.com

Produced by Yehuda Shiran and Tomer Shiran

internet.commediabistro.comJusttechjobs.comGraphics.com

Search:

WebMediaBrands Corporate Info

Legal Notices, Licensing, Reprints, Permissions, Privacy Policy.
Advertise | Newsletters | Shopping | E-mail Offers | Freelance Jobs

webref The latest from WebReference.com Browse >
Building a Banking Application Home Page with OOP · Mixing Scripting Languages · Review: phpFox, a Social Networking CMS with all the Bells and Whistles
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
Enterprise 2.0: Social Networking in the Cloud · BroadSoft Marketplace Hastens Pace of Telephony Innovation · Review: HTC Hero for Sprint


Created: May 22, 2000
Revised: June 11, 2000

URL: http://www.webreference.com/js/column62/3.html